<template>
    <!-- 结算中心/结算规则配置 -->
    <div class="checkWorkAccount">
        <div class="top_operation">
            
            <div class="every_operation" v-if="isRegionShow">
                <span><b style="color:red;">*</b> 大区：</span>
                <a-select
                    show-search
                    :filter-option="filterOption"
                    style="width: 195px" 
                    @change="regionChange" 
                    v-model="regionId" 
                    placeholder="请选择大区"
                >
                    <a-select-option :key="index" v-for="(item, index) in regionList" :value="item.id">
                        {{item.name}}
                    </a-select-option>
                </a-select>
            </div>
            <div class="every_operation" v-if="isCityShow">
                <span><b style="color:red;">*</b> 城市：</span>
                <a-select
                    show-search
                    :filter-option="filterOption"
                    style="width: 195px" 
                    @change="cityChange" 
                    v-model="cityId"
                    placeholder="请选择城市"
                >
                    <a-select-option :key="index" v-for="(item, index) in cityList" :value="item.id">
                        {{item.name}}
                    </a-select-option>
                </a-select>
            </div>
            <div class="every_operation" v-if="isWareShow">
                <span><b style="color:red;">*</b> 仓库：</span>
                <a-select
                    show-search
                    :filter-option="filterOption" 
                    style="width: 195px" 
                    @change="warehouseChange" 
                    v-model="organizeId"
                    placeholder="请选择仓库"
                >
                    <a-select-option :key="index" v-for="(item, index) in warehouseList" :value="item.id">
                        {{item.name}}
                    </a-select-option>
                </a-select>
            </div>

            <div class="every_operation">
                <span>类型：</span>
                <a-select style="width: 195px" @change="handleChange" v-model="ruleType" allowClear placeholder="请选择类型">
                    <a-select-option value="RK">
                        入库操作费规则
                    </a-select-option>
                    <a-select-option value="ZPTF">
                        赠品投放费规则
                    </a-select-option>
                    <a-select-option value="DBCK">
                        调拨出库费规则
                    </a-select-option>
                    <a-select-option value="DDLJ">
                        订单拦截费规则
                    </a-select-option>
                    <a-select-option value="CK">
                        出库操作费规则
                    </a-select-option>
                </a-select>
            </div>
            <div class="every_operation" style="margin-top:10px;">
                <span>状态：</span>
                <a-select style="width: 195px" @change="handleChange" v-model="ruleStatus" allowClear placeholder="请选择状态">
                    <a-select-option value="0">
                        启用
                    </a-select-option>
                    <a-select-option value="1">
                        禁用
                    </a-select-option>
                </a-select>
            </div>
            <div class="every_operation">
                <span>项目名称：</span>
                <a-input placeholder="请输入项目名称" v-model="projectName" style="width:195px;" :maxLength="128" allowClear/>
            </div>
            
            <div class="every_operation">
                <span>客户：</span>
                <a-select style="width: 195px"
                    show-search
                    :filter-option="filterOption"
                    @change="handleChange" 
                    v-model="customerCode" 
                    placeholder="请选择客户"
                    allowClear
                >
                    <a-select-option :key="index" v-for="(item, index) in customerList" :value="item.customerCode">
                        {{item.customerName}}
                    </a-select-option>
                </a-select>
            </div>

            <div class="every_operation">
                <span>创建人：</span>
                <a-input placeholder="请输入创建人" v-model="createBy" style="width:195px;" :maxLength="50" allowClear/>
            </div>
            <div class="every_operation">
                <span>创建时间：</span>
                <a-range-picker
                    v-model="createTime"
                    :show-time="{ format: 'HH:mm:ss' }"
                    format="YYYY-MM-DD HH:mm:ss"
                    :placeholder="['Start Time', 'End Time']"
                    @change="createChange"
                    @ok="createOk"
                    style="width:195px;"
                />
            </div>
            <div class="every_operation">
                <span>修改人：</span>
                <a-input placeholder="请输入修改人" v-model="updateBy" style="width:195px;" :maxLength="50" allowClear/>
            </div>
            <div class="every_operation">
                <span>修改时间：</span>
                <a-range-picker
                    v-model="updateTime"
                    :show-time="{ format: 'HH:mm:ss' }"
                    format="YYYY-MM-DD HH:mm:ss"
                    :placeholder="['Start Time', 'End Time']"
                    @change="editChange"
                    @ok="editOk"
                    style="width:195px;"
                />
            </div>
            <div class="every_operation">
                <span>项目备注：</span>
                <a-input placeholder="请输入项目备注" v-model="remark" style="width:195px;" :maxLength="50" allowClear/>
            </div>

            <div class="button_div">
                <a-button type="primary" icon="search" @click="onSearch()">搜索</a-button>
                <a-button type="primary" icon="sync" style="margin-left:10px;" @click="onReset()">重置</a-button>
            </div>
        </div>
        
        <div class="add_btn">
            <a-dropdown>
                <a-menu slot="overlay" @click="handleMenuClick">
                    <a-menu-item key="RK">
                        入库操作费规则
                    </a-menu-item>
                    <a-menu-item key="ZPTF">
                        赠品投放费规则
                    </a-menu-item>
                    <a-menu-item key="DBCK">
                        调拨出库费规则
                    </a-menu-item>
                    <a-menu-item key="DDLJ">
                        订单拦截费规则
                    </a-menu-item>
                    <a-menu-item key="CK">
                        出库操作费规则
                    </a-menu-item>
                </a-menu>
                <a-button type="primary" style="width:82px;">新增<a-icon type="down" /> </a-button>
            </a-dropdown>
            <a-button style="width:82px;margin-left:10px;" @click="batchDelete()">删除</a-button>
            <a-button style="margin-left:10px;" @click="doEnable()">启用</a-button>
            <a-button style="margin-left:10px;" @click="doDisable()">禁用</a-button>
            <a-button style="margin-left:10px;" @click="doExport()">导出</a-button>
            <!-- 导出对话框 -->
            <a-modal
                title="导出确认"
                :visible="exportVisible"
                :confirm-loading="exportConfirmLoading"
                @ok="exportHandleOk"
                @cancel="exportHandleCancel"
            >
                <span>确定导出？</span>
            </a-modal>

            <!-- 入库右滑抽屉开始 -->
            <a-drawer
                :title="drawerTitle"
                :placement="placement"
                :closable="false"
                :visible="visible"
                @close="onClose"
                :maskClosable="false"
                width="1000"
            >
                <a-form-model
                    ref="ruleForm"
                    :model="form"
                    :rules="rules"
                    :label-col="labelCol"
                    :wrapper-col="wrapperCol"
                    labelAlign="right"
                    layout="inline"
                >
                    
                    <a-form-model-item ref="projectName" label="项目名称" prop="projectName" style="width:48%;height:60px;float:left;margin-bottom:0;">
                        <a-input
                            v-model="form.projectName"
                            placeholder="请输入项目名称"
                            @blur="() => {$refs.projectName.onFieldBlur()}"
                            :maxLength="128"
                            :disabled="btnDisabled"
                        />
                    </a-form-model-item>
                    <a-form-model-item ref="customerCode" label="客户" prop="customerCode" style="width:48%;height:60px;float:left;margin-bottom:0;">
                        <a-select 
                            style="width: 100%" 
                            show-search
                            :filter-option="filterOption"
                            @change="customerChange" 
                            v-model="form.customerCode"
                            :disabled="btnDisabled"
                            placeholder="请选择客户"
                        >
                            <a-select-option :key="index" v-for="(item, index) in form.customerList" :value="item.customerCode">
                                {{item.customerName}}
                            </a-select-option>
                        </a-select>
                    </a-form-model-item>
                    <a-form-model-item ref="ownerCode" label="货主" prop="ownerCode" style="width:48%;height:60px;float:left;margin-bottom:0;">
                        <a-select 
                            style="width: 100%" 
                            show-search
                            :filter-option="filterOption"
                            @change="handleChange" 
                            v-model="form.ownerCode"
                            mode="multiple"
                            :maxTagCount="2"
                            :disabled="btnDisabled"
                            placeholder="请选择货主"
                        >
                            <a-select-option :key="index" v-for="(item, index) in form.ownerList" :value="item.ownerCode">
                                {{item.ownerName}}
                            </a-select-option>
                            <a-select-option value="b-other">
                                其他
                            </a-select-option>
                        </a-select>
                    </a-form-model-item>

                    <a-form-model-item ref="logisticsCompanyCode" label="物流公司" prop="logisticsCompanyCode" style="width:48%;height:60px;float:left;margin-bottom:0;" v-if="isLogisticsCompanyShow">
                        <a-select 
                            style="width: 100%" 
                            show-search
                            :filter-option="filterOption"
                            @change="handleChange" 
                            v-model="form.logisticsCompanyCode"
                            mode="multiple"
                            :maxTagCount="2"
                            :disabled="btnDisabled"
                            placeholder="请选择物流公司"
                        >
                            <a-select-option :key="index" v-for="(item, index) in form.logisticsCompanyList" :value="item.logisticsCompanyCode">
                                {{item.logisticsCompanyCode}}
                            </a-select-option>
                            <a-select-option value="b-other">
                                其他
                            </a-select-option>
                        </a-select>
                    </a-form-model-item>
                    <a-form-model-item ref="platformCode" label="平台" prop="platformCode" style="width:48%;height:60px;float:left;margin-bottom:0;" v-if="isPlatformShow">
                        <a-select 
                            style="width: 100%" 
                            show-search
                            :filter-option="filterOption"
                            @change="platformChange" 
                            v-model="form.platformCode"
                            mode="multiple"
                            :maxTagCount="2"
                            :disabled="btnDisabled"
                            placeholder="请选择平台"
                        >
                            <a-select-option :key="index" v-for="(item, index) in form.platformList" :value="item.platformCode">
                                {{item.platformCode}}
                            </a-select-option>
                            <a-select-option value="b-other">
                                其他
                            </a-select-option>
                        </a-select>
                    </a-form-model-item>
                    <a-form-model-item ref="shopCode" label="店铺" prop="shopCode" style="width:48%;height:60px;float:left;margin-bottom:0;" v-if="isShopShow">
                        <a-select 
                            style="width: 100%" 
                            show-search
                            :filter-option="filterOption"
                            @change="handleChange" 
                            v-model="form.shopCode"
                            mode="multiple"
                            :maxTagCount="1"
                            :disabled="btnDisabled"
                            placeholder="请选择店铺"
                        >
                            <a-select-option :key="index" v-for="(item, index) in form.shopList" :value="item.shopCode">
                                {{item.shopCode}}
                            </a-select-option>
                            <a-select-option value="b-other">
                                其他
                            </a-select-option>
                        </a-select>
                    </a-form-model-item>

                    <a-form-model-item ref="orderType" label="订单类型" prop="orderType" style="width:48%;height:60px;float:left;margin-bottom:0;" v-if="isOrderShow">
                        <a-select 
                            style="width: 100%" 
                            @change="handleChange" 
                            v-model="form.orderType" 
                            :mode="selectMode"
                            :maxTagCount="2"
                            :disabled="btnDisabled"
                            placeholder="请选择订单类型"
                        >
                            <a-select-option value="db" v-if="this.key == 'ZPTF'">
                                调拨
                            </a-select-option>
                            <a-select-option value="hl" v-if="this.key == 'ZPTF'">
                                合流
                            </a-select-option>
                            <a-select-option value="multi" v-if="this.key == 'ZPTF'">
                                多件
                            </a-select-option>
                            <a-select-option value="single" v-if="this.key == 'ZPTF'">
                                单件
                            </a-select-option>
                            <a-select-option value="b-other" v-if="this.key == 'ZPTF'">
                                其他
                            </a-select-option>
                            <a-select-option value="CGRK" v-if="this.key == 'RK'">
                                采购入库
                            </a-select-option>
                            <a-select-option value="THRK" v-if="this.key == 'RK'">
                                退货入库
                            </a-select-option>
                            <a-select-option value="DBRK" v-if="this.key == 'RK'">
                                调拨入库
                            </a-select-option>
                            <a-select-option value="QTRK" v-if="this.key == 'RK'">
                                其他入库
                            </a-select-option>
                        </a-select>
                    </a-form-model-item>

                    <!-- 计费模式 -->
                    <a-form-model-item ref="billingModel" label="计费模式" prop="billingModel" style="width:48%;height:60px;float:left;margin-bottom:0;" v-if="this.key == 'DBCK'">
                        <a-select 
                            style="width: 100%" 
                            show-search
                            :filter-option="filterOption"
                            @change="billingModelChange" 
                            v-model="form.billingModel"
                            :disabled="btnDisabled"
                        >
                            <a-select-option value="piece">
                                按件计费
                            </a-select-option>
                            <a-select-option value="box">
                                按箱计费
                            </a-select-option>
                            <a-select-option value="order">
                                按单计费
                            </a-select-option>
                        </a-select>
                    </a-form-model-item>
                    
                    <!-- 数量区间、规则价格 -->
                    <!-- 按单计费 -->
                    <div v-if="this.isOrderModel">
                        <div style="width:100%;height:55px;float:left;margin-top:10px;" :key="index" v-for="(item, index) in form.standardRuleInfos">
                            <div style="width:50%;float:left;">
                                <span style="padding-left:53px;"><span style="color:red;font-weight:bolder;">* </span>数量区间：</span>
                                <a-input-number v-model="item.quantityBeginValue" style="width:110px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入数量区间"/>
                                -
                                <a-input-number v-model="item.quantityEndValue" style="width:110px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入数量区间"/>
                                <a-select v-model="item.quantityUnit" style="width:60px;margin-left:12px;" default-value="piece" @change="standardUnitChange" :disabled="btnDisabled">
                                    <a-select-option value="piece">
                                        件
                                    </a-select-option>
                                    <a-select-option value="box">
                                        箱
                                    </a-select-option>
                                </a-select>
                            </div>
                            <div style="width:50%;float:left;">
                                <span style="padding-left:28px;"><span style="color:red;font-weight:bolder;">* </span>规则价格(元)：</span>
                                <a-input-number v-model="item.rulePrice" style="width:303px;" :min="0" :max="2147483647" :precision="2" :disabled="btnDisabled" placeholder="请输入规则价格"/>
                            </div>
                            <div style="width:100%;height:20px;float:left;margin-top:3px;padding-left:130px;">
                                <div style="cursor:pointer;float:left;margin-right:20px;" @click="cutRule(index)" v-if="item.isCutShow">
                                    <img style="width:20px;margin-top:-3px;" src="~@/assets/cut.png" alt="">
                                    <span style="color:#cdcdcd;font-size:14px;">删除规则</span>
                                </div>
                                <div style="cursor:pointer;float:left;" @click="plusRule()" v-if="item.isPlusShow">
                                    <img style="width:18px;margin-top:-3px;" src="~@/assets/plus.png" alt="">
                                    <span style="color:#cdcdcd;font-size:14px;">添加规则</span>
                                </div>
                            </div>
                        </div>

                        <!-- 续重规则配置 -->
                        <div style="width:100%;height:30px;float:left;margin-top:15px;">
                            <span style="padding-left:24px;"><span style="color:red;font-weight:bolder;">* </span>续重规则配置：</span>
                            <a-radio-group v-model="form.weightRuleStatus" @change="weightRuleStatusChange" :disabled="btnDisabled">
                                <a-radio :value="0">
                                    是
                                </a-radio>
                                <a-radio :value="1">
                                    否
                                </a-radio>
                            </a-radio-group>
                        </div>
                        <div style="width:100%;height:55px;float:left;margin-top:10px;" v-if="form.weightRuleShow">
                            <div style="width:50%;float:left;">
                                <span style="padding-left:80px;"><span style="color:red;font-weight:bolder;">* </span>数量：</span>
                                <a-input-number v-model="form.weightRuleInfos[0].quantity" style="width:235px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入数量"/>
                                <a-select v-model="form.weightRuleInfos[0].quantityUnit" style="width:60px;margin-left:12px;" default-value="piece" @change="standardUnitChange" :disabled="btnDisabled">
                                    <a-select-option value="piece">
                                        件
                                    </a-select-option>
                                    <a-select-option value="box">
                                        箱
                                    </a-select-option>
                                </a-select>
                            </div>
                            <div style="width:50%;float:left;">
                                <span style="padding-left:28px;"><span style="color:red;font-weight:bolder;">* </span>规则价格(元)：</span>
                                <a-input-number v-model="form.weightRuleInfos[0].quantityPrice" style="width:303px;" :min="0" :max="2147483647" :precision="2" :disabled="btnDisabled" placeholder="请输入规则价格"/>
                            </div>
                        </div>
                    </div>

                    <!-- 按件计费、按箱计费 -->
                    <div v-if="!this.isOrderModel">
                        <div style="width:100%;height:55px;float:left;margin-top:10px;" :key="index" v-for="(item, index) in form.standardRuleInfos">
                            <div style="width:50%;float:left;">
                                <span style="padding-left:28px;"><span style="color:red;font-weight:bolder;">* </span>规则价格(元)：</span>
                                <a-input-number v-model="item.rulePrice" style="width:303px;" :min="0" :max="2147483647" :precision="2" :disabled="btnDisabled" placeholder="请输入规则价格"/>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 备注 -->
                    <div style="width:100%;height:85px;float:left;position:relative;">
                        <span style="padding-left:60px;position:absolute;top:0px;">项目备注：</span>
                        <a-textarea
                            v-model="form.remark"
                            placeholder="请输入项目备注"
                            :auto-size="{ minRows: 3, maxRows: 5 }"
                            style="width:779px;height:85px;margin-left:131px;"
                            :maxLength="1024"
                            :disabled="btnDisabled"
                        />
                    </div>
                    
                    <a-form-model-item :wrapper-col="{ span: 14, offset: 4 }" style="width:100%;margin-top:10px;">
                        <a-button :disabled="btnDisabled" type="primary" @click="onSubmit">
                            确定
                        </a-button>
                        <a-button style="margin-left: 10px;" @click="cancelForm">
                            取消
                        </a-button>
                    </a-form-model-item>
                </a-form-model>
            </a-drawer>
            <!-- 入库右滑抽屉结束 -->

            <!-- 出库右滑抽屉开始 -->
            <a-drawer
                :title="ckDrawerTitle"
                :placement="placement"
                :closable="false"
                :visible="ckVisible"
                @close="ckOnClose"
                :maskClosable="false"
                width="1000"
            >
                <a-form-model
                    ref="ckRuleForm"
                    :model="ckForm"
                    :rules="ckRules"
                    :label-col="labelCol"
                    :wrapper-col="wrapperCol"
                    labelAlign="right"
                    layout="inline"
                >   
                    <!-- 基本信息开始 -->
                    <p style="width:100%;height:20px;font-weight:bolder;float:left;"><span style="color:red;">*</span>基本信息</p>
                    <a-form-model-item ref="projectName" label="项目名称" prop="projectName" style="width:48%;height:60px;float:left;margin-bottom:0;">
                        <a-input
                            v-model="ckForm.projectName"
                            placeholder="请输入项目名称"
                            @blur="() => {$refs.projectName.onFieldBlur()}"
                            :maxLength="128"
                            :disabled="btnDisabled"
                        />
                    </a-form-model-item>
                    <a-form-model-item ref="customerCode" label="客户" prop="customerCode" style="width:48%;height:60px;float:left;margin-bottom:0;">
                        <a-select 
                            style="width: 100%" 
                            show-search
                            :filter-option="filterOption"
                            @change="customerChange" 
                            v-model="ckForm.customerCode"
                            :disabled="btnDisabled"
                            placeholder="请选择客户"
                        >
                            <a-select-option :key="index" v-for="(item, index) in ckForm.customerList" :value="item.customerCode">
                                {{item.customerName}}
                            </a-select-option>
                        </a-select>
                    </a-form-model-item>
                    <a-form-model-item ref="ownerCode" label="货主" prop="ownerCode" style="width:48%;height:60px;float:left;margin-bottom:0;">
                        <a-select 
                            style="width: 100%" 
                            show-search
                            :filter-option="filterOption"
                            @change="handleChange" 
                            v-model="ckForm.ownerCode"
                            mode="multiple"
                            :maxTagCount="2"
                            :disabled="btnDisabled"
                            placeholder="请选择货主"
                        >
                            <a-select-option :key="index" v-for="(item, index) in ckForm.ownerList" :value="item.ownerCode">
                                {{item.ownerName}}
                            </a-select-option>
                            <a-select-option value="b-other">
                                其他
                            </a-select-option>
                        </a-select>
                    </a-form-model-item>

                    <a-form-model-item ref="logisticsCompanyCode" label="物流公司" prop="logisticsCompanyCode" style="width:48%;height:60px;float:left;margin-bottom:0;">
                        <a-select 
                            style="width: 100%" 
                            show-search
                            :filter-option="filterOption"
                            @change="handleChange" 
                            v-model="ckForm.logisticsCompanyCode"
                            mode="multiple"
                            :maxTagCount="2"
                            :disabled="btnDisabled"
                            placeholder="请选择物流公司"
                        >
                            <a-select-option :key="index" v-for="(item, index) in ckForm.logisticsCompanyList" :value="item.logisticsCompanyCode">
                                {{item.logisticsCompanyCode}}
                            </a-select-option>
                            <a-select-option value="b-other">
                                其他
                            </a-select-option>
                        </a-select>
                    </a-form-model-item>
                    <a-form-model-item ref="platformCode" label="平台" prop="platformCode" style="width:48%;height:60px;float:left;margin-bottom:0;">
                        <a-select 
                            style="width: 100%" 
                            show-search
                            :filter-option="filterOption"
                            @change="platformChange" 
                            v-model="ckForm.platformCode"
                            mode="multiple"
                            :maxTagCount="2"
                            :disabled="btnDisabled"
                            placeholder="请选择平台"
                        >
                            <a-select-option :key="index" v-for="(item, index) in ckForm.platformList" :value="item.platformCode">
                                {{item.platformCode}}
                            </a-select-option>
                            <a-select-option value="b-other">
                                其他
                            </a-select-option>
                        </a-select>
                    </a-form-model-item>
                    <a-form-model-item ref="shopCode" label="店铺" prop="shopCode" style="width:48%;height:60px;float:left;margin-bottom:0;">
                        <a-select 
                            style="width: 100%" 
                            show-search
                            :filter-option="filterOption"
                            @change="handleChange" 
                            v-model="ckForm.shopCode"
                            mode="multiple"
                            :maxTagCount="1"
                            :disabled="btnDisabled"
                            placeholder="请选择店铺"
                        >
                            <a-select-option :key="index" v-for="(item, index) in ckForm.shopList" :value="item.shopCode">
                                {{item.shopCode}}
                            </a-select-option>
                            <a-select-option value="b-other">
                                其他
                            </a-select-option>
                        </a-select>
                    </a-form-model-item>

                    <a-form-model-item ref="orderType" label="订单类型" prop="orderType" style="width:48%;height:60px;float:left;margin-bottom:0;">
                        <a-select 
                            style="width: 100%" 
                            @change="handleChange" 
                            v-model="ckForm.orderType" 
                            mode="multiple"
                            :maxTagCount="2"
                            :disabled="btnDisabled"
                            placeholder="请选择订单类型"
                        >
                            <!-- <a-select-option value="db">
                                调拨
                            </a-select-option> -->
                            <a-select-option value="hl">
                                合流
                            </a-select-option>
                            <a-select-option value="multi">
                                多件
                            </a-select-option>
                            <a-select-option value="single">
                                单件
                            </a-select-option>
                            <a-select-option value="b-other">
                                其他
                            </a-select-option>
                        </a-select>
                    </a-form-model-item>

                    <!-- 备注 -->
                    <div style="width:100%;height:85px;float:left;position:relative;">
                        <span style="padding-left:60px;position:absolute;top:0px;">项目备注：</span>
                        <a-textarea
                            v-model="ckForm.remark"
                            placeholder="请输入项目备注"
                            :auto-size="{ minRows: 3, maxRows: 5 }"
                            style="width:779px;height:85px;margin-left:131px;"
                            :maxLength="1024"
                            :disabled="btnDisabled"
                        />
                    </div>
                    <!-- 基本信息结束 -->
                    
                    <!-- 规则配置开始 -->
                    <p style="width:100%;height:20px;margin-top:20px;font-weight:bolder;float:left;"><span style="color:red;">*</span>规则配置</p>
                    
                    <!-- 标准规则开关 -->
                    <div style="width:100%;height:26px;float:left;">
                        <span style="line-height:26px;padding-left:36px;">标准规则配置：</span>
                        <a-switch v-model="ckForm.standardSwitchValue" @change="standardSwitchChange" :disabled="btnDisabled"/>
                    </div>
                    <!-- 标准规则盒子 -->
                    <div v-if="ckForm.isCkStandardShow">
                        <div style="width:100%;min-height:110px;float:left;margin-top:10px;" :key="index" v-for="(item, index) in ckForm.standardRuleInfos">
                            <div style="width:50%;height:33px;float:left;">
                                <span style="padding-left:53px;"><span style="color:red;font-weight:bolder;">* </span>数量区间：</span>
                                <a-input-number v-model="item.quantityBeginValue" style="width:110px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入数量区间"/>
                                -
                                <a-input-number v-model="item.quantityEndValue" style="width:110px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入数量区间"/>
                                <a-select v-model="item.quantityUnit" style="width:60px;margin-left:12px;" default-value="piece" @change="ckUnitChange" :disabled="btnDisabled">
                                    <a-select-option value="piece">
                                        件
                                    </a-select-option>
                                    <a-select-option value="box">
                                        箱
                                    </a-select-option>
                                </a-select>
                            </div>
                            <div style="width:50%;height:33px;float:left;">
                                <span style="padding-left:53px;"><span style="color:red;font-weight:bolder;">* </span>SKU类数：</span>
                                <a-input-number v-model="item.skuBeginValue" style="width:147px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入SKU类数"/>
                                -
                                <a-input-number v-model="item.skuEndValue" style="width:147px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入SKU类数"/>
                            </div>
                            <div style="width:50%;height:33px;float:left;margin-top:20px;">
                                <span style="padding-left:30px;"><span style="color:red;font-weight:bolder;">* </span>重量区间(kg)：</span>
                                <a-input-number v-model="item.weightBeginValue" style="width:147px;" :min="0" :max="2147483647" :precision="3" :disabled="btnDisabled" placeholder="请输入重量区间"/>
                                -
                                <a-input-number v-model="item.weightEndValue" style="width:147px;" :min="0" :max="2147483647" :precision="3" :disabled="btnDisabled" placeholder="请输入重量区间"/>
                            </div>
                            <div style="width:50%;height:33px;float:left;margin-top:20px;">
                                <span style="padding-left:28px;"><span style="color:red;font-weight:bolder;">* </span>规则价格(元)：</span>
                                <a-input-number v-model="item.rulePrice" style="width:303px;" :min="0" :max="2147483647" :precision="2" :disabled="btnDisabled" placeholder="请输入规则价格"/>
                            </div>
                            <div style="width:100%;height:20px;float:left;margin-top:3px;padding-left:130px;margin-bottom:10px;">
                                <div style="cursor:pointer;float:left;margin-right:20px;" @click="ckStandardCutRule(index)" v-if="item.isCutShow">
                                    <img style="width:20px;margin-top:-3px;" src="~@/assets/cut.png" alt="">
                                    <span style="color:#cdcdcd;font-size:14px;">删除规则</span>
                                </div>
                                <div style="cursor:pointer;float:left;" @click="ckStandardPlusRule()" v-if="item.isPlusShow">
                                    <img style="width:18px;margin-top:-3px;" src="~@/assets/plus.png" alt="">
                                    <span style="color:#cdcdcd;font-size:14px;">添加规则</span>
                                </div>
                            </div>
                        </div>

                        <!-- 标准续重规则配置 -->
                        <div style="width:100%;float:left;">
                            <span style="padding-left:24px;"><span style="color:red;font-weight:bolder;">* </span>续重规则配置：</span>
                            <a-radio-group v-model="ckForm.standardRuleInfos[0].weightRuleStatus" @change="ckStandardWeightChange" :disabled="btnDisabled">
                                <a-radio :value="0">
                                    是
                                </a-radio>
                                <a-radio :value="1">
                                    否
                                </a-radio>
                            </a-radio-group>
                        </div>
                        <div style="width:100%;float:left;margin-top:10px;" v-if="ckForm.isCkStandardWeightShow">
                            <div style="width:50%;height:33px;float:left;">
                                <span style="padding-left:90px;">数量：</span>
                                <a-input-number v-model="ckForm.standardWeightRuleInfos[0].quantity" style="width:235px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入数量"/>
                                <a-select v-model="ckForm.standardWeightRuleInfos[0].quantityUnit" style="width:60px;margin-left:12px;" default-value="piece" @change="ckUnitChange" :disabled="btnDisabled">
                                    <a-select-option value="piece">
                                        件
                                    </a-select-option>
                                    <a-select-option value="box">
                                        箱
                                    </a-select-option>
                                </a-select>
                            </div>
                            <div style="width:50%;height:33px;float:left;">
                                <span style="padding-left:38px;">规则价格(元)：</span>
                                <a-input-number v-model="ckForm.standardWeightRuleInfos[0].quantityPrice" style="width:303px;" :min="0" :max="2147483647" :precision="2" :disabled="btnDisabled" placeholder="请输入规则价格"/>
                            </div>
                            <div style="width:50%;height:33px;float:left;margin-top:20px;">
                                <span style="padding-left:64px;">SKU类数：</span>
                                <a-input-number v-model="ckForm.standardWeightRuleInfos[0].sku" style="width:308px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入SKU类数"/>
                            </div>
                            <div style="width:50%;height:33px;float:left;margin-top:20px;">
                                <span style="padding-left:38px;">规则价格(元)：</span>
                                <a-input-number v-model="ckForm.standardWeightRuleInfos[0].skuPrice" style="width:303px;" :min="0" :max="2147483647" :precision="2" :disabled="btnDisabled" placeholder="请输入规则价格"/>
                            </div>
                            <div style="width:50%;height:33px;float:left;margin-top:20px;">
                                <span style="padding-left:66px;">重量(kg)：</span>
                                <a-input-number v-model="ckForm.standardWeightRuleInfos[0].weight" style="width:308px;" :min="0" :max="2147483647" :precision="3" :disabled="btnDisabled" placeholder="请输入重量"/>
                            </div>
                            <div style="width:50%;height:33px;float:left;margin-top:20px;">
                                <span style="padding-left:38px;">规则价格(元)：</span>
                                <a-input-number v-model="ckForm.standardWeightRuleInfos[0].weightPrice" style="width:303px;" :min="0" :max="2147483647" :precision="2" :disabled="btnDisabled" placeholder="请输入规则价格"/>
                            </div>
                        </div>
                    </div>

                    <!-- 特殊规则开关 -->
                    <div style="width:100%;height:26px;float:left;margin-top:20px;">
                        <span style="line-height:26px;padding-left:36px;">特殊规则配置：</span>
                        <a-switch v-model="ckForm.specialSwitchValue" @change="specialSwitchChange" :disabled="btnDisabled"/>
                    </div>
                    <div v-if="ckForm.isCkSpecialShow">
                        <!-- 冷库 -->
                        <div style="width:100%;float:left;margin-top:15px;">
                            <span style="padding-left:53px;"><span style="color:red;font-weight:bolder;">* </span>是否冷库：</span>
                            <a-radio-group v-model="ckForm.coldRuleStatus" @change="ckColdChange" :disabled="btnDisabled">
                                <a-radio :value="0">
                                    是
                                </a-radio>
                                <a-radio :value="1">
                                    否
                                </a-radio>
                            </a-radio-group>
                        </div>

                        <div v-if="ckForm.isCkColdShow">
                            <div style="width:100%;min-height:110px;float:left;margin-top:10px;" :key="index" v-for="(item, index) in ckForm.coldRuleInfos">
                                <div style="width:50%;height:33px;float:left;">
                                    <span style="padding-left:53px;"><span style="color:red;font-weight:bolder;">* </span>数量区间：</span>
                                    <a-input-number v-model="item.quantityBeginValue" style="width:110px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入数量区间"/>
                                    -
                                    <a-input-number v-model="item.quantityEndValue" style="width:110px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入数量区间"/>
                                    <a-select v-model="item.quantityUnit" style="width:60px;margin-left:12px;" default-value="piece" @change="ckUnitChange" :disabled="btnDisabled">
                                        <a-select-option value="piece">
                                            件
                                        </a-select-option>
                                        <a-select-option value="box">
                                            箱
                                        </a-select-option>
                                    </a-select>
                                </div>
                                <div style="width:50%;height:33px;float:left;">
                                    <span style="padding-left:53px;"><span style="color:red;font-weight:bolder;">* </span>SKU类数：</span>
                                    <a-input-number v-model="item.skuBeginValue" style="width:147px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入SKU类数"/>
                                    -
                                    <a-input-number v-model="item.skuEndValue" style="width:147px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入SKU类数"/>
                                </div>
                                <div style="width:50%;height:33px;float:left;margin-top:20px;">
                                    <span style="padding-left:30px;"><span style="color:red;font-weight:bolder;">* </span>重量区间(kg)：</span>
                                    <a-input-number v-model="item.weightBeginValue" style="width:147px;" :min="0" :max="2147483647" :precision="3" :disabled="btnDisabled" placeholder="请输入重量区间"/>
                                    -
                                    <a-input-number v-model="item.weightEndValue" style="width:147px;" :min="0" :max="2147483647" :precision="3" :disabled="btnDisabled" placeholder="请输入重量区间"/>
                                </div>
                                <div style="width:50%;height:33px;float:left;margin-top:20px;">
                                    <span style="padding-left:28px;"><span style="color:red;font-weight:bolder;">* </span>规则价格(元)：</span>
                                    <a-input-number v-model="item.rulePrice" style="width:303px;" :min="0" :max="2147483647" :precision="2" :disabled="btnDisabled" placeholder="请输入规则价格"/>
                                </div>
                                <div style="width:100%;height:20px;float:left;margin-top:3px;padding-left:130px;margin-bottom:10px;">
                                    <div style="cursor:pointer;float:left;margin-right:20px;" @click="ckColdStandardCutRule(index)" v-if="item.isCutShow">
                                        <img style="width:20px;margin-top:-3px;" src="~@/assets/cut.png" alt="">
                                        <span style="color:#cdcdcd;font-size:14px;">删除规则</span>
                                    </div>
                                    <div style="cursor:pointer;float:left;" @click="ckColdStandardPlusRule()" v-if="item.isPlusShow">
                                        <img style="width:18px;margin-top:-3px;" src="~@/assets/plus.png" alt="">
                                        <span style="color:#cdcdcd;font-size:14px;">添加规则</span>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- 冷库续重规则配置 -->
                        <div style="width:100%;float:left;">
                            <span style="padding-left:25px;"><span style="color:red;font-weight:bolder;">* </span>续重规则配置：</span>
                            <a-radio-group v-model="ckForm.coldWeightStatus" @change="ckColdWeightChange" :disabled="btnDisabled">
                                <a-radio :value="0">
                                    是
                                </a-radio>
                                <a-radio :value="1">
                                    否
                                </a-radio>
                            </a-radio-group>
                        </div>
                        <div style="width:100%;float:left;margin-top:10px;" v-if="ckForm.isCkColdWeightShow">
                            <div style="width:50%;height:33px;float:left;">
                                <span style="padding-left:90px;">数量：</span>
                                <a-input-number v-model="ckForm.coldWeightRuleInfos[0].quantity" style="width:235px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入数量"/>
                                <a-select v-model="ckForm.coldWeightRuleInfos[0].quantityUnit" style="width:60px;margin-left:12px;" default-value="piece" @change="ckUnitChange" :disabled="btnDisabled">
                                    <a-select-option value="piece">
                                        件
                                    </a-select-option>
                                    <a-select-option value="box">
                                        箱
                                    </a-select-option>
                                </a-select>
                            </div>
                            <div style="width:50%;height:33px;float:left;">
                                <span style="padding-left:38px;">规则价格(元)：</span>
                                <a-input-number v-model="ckForm.coldWeightRuleInfos[0].quantityPrice" style="width:303px;" :min="0" :max="2147483647" :precision="2" :disabled="btnDisabled" placeholder="请输入规则价格"/>
                            </div>
                            <div style="width:50%;height:33px;float:left;margin-top:20px;">
                                <span style="padding-left:64px;">SKU类数：</span>
                                <a-input-number v-model="ckForm.coldWeightRuleInfos[0].sku" style="width:308px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入SKU类数"/>
                            </div>
                            <div style="width:50%;height:33px;float:left;margin-top:20px;">
                                <span style="padding-left:38px;">规则价格(元)：</span>
                                <a-input-number v-model="ckForm.coldWeightRuleInfos[0].skuPrice" style="width:303px;" :min="0" :max="2147483647" :precision="2" :disabled="btnDisabled" placeholder="请输入规则价格"/>
                            </div>
                            <div style="width:50%;height:33px;float:left;margin-top:20px;">
                                <span style="padding-left:66px;">重量(kg)：</span>
                                <a-input-number v-model="ckForm.coldWeightRuleInfos[0].weight" style="width:308px;" :min="0" :max="2147483647" :precision="3" :disabled="btnDisabled" placeholder="请输入重量"/>
                            </div>
                            <div style="width:50%;height:33px;float:left;margin-top:20px;">
                                <span style="padding-left:38px;">规则价格(元)：</span>
                                <a-input-number v-model="ckForm.coldWeightRuleInfos[0].weightPrice" style="width:303px;" :min="0" :max="2147483647" :precision="2" :disabled="btnDisabled" placeholder="请输入规则价格"/>
                            </div>
                        </div>

                        <!-- 酒水 -->
                        <div style="width:100%;float:left;margin-top:15px;">
                            <span style="padding-left:25px;"><span style="color:red;font-weight:bolder;">* </span>是否酒水订单：</span>
                            <a-radio-group v-model="ckForm.drinksRuleStatus" @change="ckDrinksChange" :disabled="btnDisabled">
                                <a-radio :value="0">
                                    是
                                </a-radio>
                                <a-radio :value="1">
                                    否
                                </a-radio>
                            </a-radio-group>
                        </div>

                        <div v-if="ckForm.isCkDrinksShow">
                            <div style="width:100%;min-height:110px;float:left;margin-top:10px;" :key="index+1" v-for="(item, index) in ckForm.drinksRuleInfos">
                                <div style="width:50%;height:33px;float:left;">
                                    <span style="padding-left:53px;"><span style="color:red;font-weight:bolder;">* </span>数量区间：</span>
                                    <a-input-number v-model="item.quantityBeginValue" style="width:110px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入数量区间"/>
                                    -
                                    <a-input-number v-model="item.quantityEndValue" style="width:110px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入数量区间"/>
                                    <a-select v-model="item.quantityUnit" style="width:60px;margin-left:12px;" default-value="piece" @change="ckUnitChange" :disabled="btnDisabled">
                                        <a-select-option value="piece">
                                            件
                                        </a-select-option>
                                        <a-select-option value="box">
                                            箱
                                        </a-select-option>
                                    </a-select>
                                </div>
                                <div style="width:50%;height:33px;float:left;">
                                    <span style="padding-left:53px;"><span style="color:red;font-weight:bolder;">* </span>SKU类数：</span>
                                    <a-input-number v-model="item.skuBeginValue" style="width:147px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入SKU类数"/>
                                    -
                                    <a-input-number v-model="item.skuEndValue" style="width:147px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入SKU类数"/>
                                </div>
                                <div style="width:50%;height:33px;float:left;margin-top:20px;">
                                    <span style="padding-left:30px;"><span style="color:red;font-weight:bolder;">* </span>重量区间(kg)：</span>
                                    <a-input-number v-model="item.weightBeginValue" style="width:147px;" :min="0" :max="2147483647" :precision="3" :disabled="btnDisabled" placeholder="请输入重量区间"/>
                                    -
                                    <a-input-number v-model="item.weightEndValue" style="width:147px;" :min="0" :max="2147483647" :precision="3" :disabled="btnDisabled" placeholder="请输入重量区间"/>
                                </div>
                                <div style="width:50%;height:33px;float:left;margin-top:20px;">
                                    <span style="padding-left:28px;"><span style="color:red;font-weight:bolder;">* </span>规则价格(元)：</span>
                                    <a-input-number v-model="item.rulePrice" style="width:303px;" :min="0" :max="2147483647" :precision="2" :disabled="btnDisabled" placeholder="请输入规则价格"/>
                                </div>
                                <div style="width:100%;height:20px;float:left;margin-top:3px;padding-left:130px;margin-bottom:10px;">
                                    <div style="cursor:pointer;float:left;margin-right:20px;" @click="ckDrinksStandardCutRule(index)" v-if="item.isCutShow">
                                        <img style="width:20px;margin-top:-3px;" src="~@/assets/cut.png" alt="">
                                        <span style="color:#cdcdcd;font-size:14px;">删除规则</span>
                                    </div>
                                    <div style="cursor:pointer;float:left;" @click="ckDrinksStandardPlusRule()" v-if="item.isPlusShow">
                                        <img style="width:18px;margin-top:-3px;" src="~@/assets/plus.png" alt="">
                                        <span style="color:#cdcdcd;font-size:14px;">添加规则</span>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- 酒水续重规则配置 -->
                        <div style="width:100%;float:left;">
                            <span style="padding-left:25px;"><span style="color:red;font-weight:bolder;">* </span>续重规则配置：</span>
                            <a-radio-group v-model="ckForm.drinksWeightStatus" @change="ckDrinksWeightChange" :disabled="btnDisabled">
                                <a-radio :value="0">
                                    是
                                </a-radio>
                                <a-radio :value="1">
                                    否
                                </a-radio>
                            </a-radio-group>
                        </div>
                        <div style="width:100%;float:left;margin-top:10px;" v-if="ckForm.isCkDrinksWeightShow">
                            <div style="width:50%;height:33px;float:left;">
                                <span style="padding-left:90px;">数量：</span>
                                <a-input-number v-model="ckForm.drinksWeightRuleInfos[0].quantity" style="width:235px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入数量"/>
                                <a-select v-model="ckForm.drinksWeightRuleInfos[0].quantityUnit" style="width:60px;margin-left:12px;" default-value="piece" @change="ckUnitChange" :disabled="btnDisabled">
                                    <a-select-option value="piece">
                                        件
                                    </a-select-option>
                                    <a-select-option value="box">
                                        箱
                                    </a-select-option>
                                </a-select>
                            </div>
                            <div style="width:50%;height:33px;float:left;">
                                <span style="padding-left:38px;">规则价格(元)：</span>
                                <a-input-number v-model="ckForm.drinksWeightRuleInfos[0].quantityPrice" style="width:303px;" :min="0" :max="2147483647" :precision="2" :disabled="btnDisabled" placeholder="请输入规则价格"/>
                            </div>
                            <div style="width:50%;height:33px;float:left;margin-top:20px;">
                                <span style="padding-left:64px;">SKU类数：</span>
                                <a-input-number v-model="ckForm.drinksWeightRuleInfos[0].sku" style="width:308px;" :min="0" :max="2147483647" :precision="0" :disabled="btnDisabled" placeholder="请输入SKU类数"/>
                            </div>
                            <div style="width:50%;height:33px;float:left;margin-top:20px;">
                                <span style="padding-left:38px;">规则价格(元)：</span>
                                <a-input-number v-model="ckForm.drinksWeightRuleInfos[0].skuPrice" style="width:303px;" :min="0" :max="2147483647" :precision="2" :disabled="btnDisabled" placeholder="请输入规则价格"/>
                            </div>
                            <div style="width:50%;height:33px;float:left;margin-top:20px;">
                                <span style="padding-left:66px;">重量(kg)：</span>
                                <a-input-number v-model="ckForm.drinksWeightRuleInfos[0].weight" style="width:308px;" :min="0" :max="2147483647" :precision="3" :disabled="btnDisabled" placeholder="请输入重量"/>
                            </div>
                            <div style="width:50%;height:33px;float:left;margin-top:20px;">
                                <span style="padding-left:38px;">规则价格(元)：</span>
                                <a-input-number v-model="ckForm.drinksWeightRuleInfos[0].weightPrice" style="width:303px;" :min="0" :max="2147483647" :precision="2" :disabled="btnDisabled" placeholder="请输入规则价格"/>
                            </div>
                        </div>

                    </div>
                    
                    <div style="width:100%;height:92px;float:left;"></div>

                    <div style="width:1000px;height:72px;border-top:1px solid #d9d9d9;position:fixed;right:0;bottom:0;background:#fff;">
                        <a-button :disabled="btnDisabled" type="primary" style="margin-top:20px;margin-left:155px;" @click="ckOnSubmit">
                            确定
                        </a-button>
                        <a-button style="margin-top:20px;margin-left:10px;" @click="ckCancelForm">
                            取消
                        </a-button>
                    </div>
                </a-form-model>
            </a-drawer>
            <!-- 出库右滑抽屉结束 -->

        </div>

        <div class="select_number">
            <span class="number_span">已选择<b>{{selectNumber}}</b>项</span>
            <span class="clear_span" @click="clearSelect">清空</span>
        </div>
        
        <div class="data_source_list">
            <div class="data_source_details">
                <a-table
                    :loading="tableLoading"
                    :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" 
                    :columns="columns" 
                    :data-source="data"
                    :pagination="false"
                    bordered
                    rowKey="id"
                    >
                    <span slot="projectName" slot-scope="text, record" href="javascript:;">
                        <a-tooltip placement="topLeft">
                            <template slot="title">
                            <span>{{text}}</span>
                            </template>
                            <span @click="doLook(record)" style="color:#f8ac59;cursor:pointer;">{{text}}</span>
                        </a-tooltip>
                    </span>

                    <span slot="rule" slot-scope="text, record">
                        <a-tooltip placement="topLeft">
                            <template slot="title">
                            <span>{{getRule(record)}}</span>
                            </template>
                            <span>{{getRule(record)}}</span>
                        </a-tooltip>
                    </span>

                    <span slot="ruleStatus" slot-scope="text, record">
                        <span v-if="record.ruleStatus == 0">启用</span>
                        <span v-else>禁用</span>
                    </span>
                    
                    <span slot="ruleType" slot-scope="text, record">
                        <a-tooltip placement="topLeft">
                            <template slot="title">
                            <span>{{getRuleType(record)}}</span>
                            </template>
                            <span>{{getRuleType(record)}}</span>
                        </a-tooltip>
                    </span>

                    <a slot="action" slot-scope="text, record" href="javascript:;">
                        <span style="margin-right:8px;" @click="doEdit(record)">修改</span>
                        <span @click="deleteDrawer(record)">删除</span>
                    </a>
                </a-table>
                <!-- 确认删除对话框 -->
                <a-modal v-model="editVisible" title="确认删除" @ok="handleOk">
                    <p style="text-align:center;">确认删除？</p>
                </a-modal>
                <!-- 底部分页组件 -->
                <BottomPagination
                    :total="total"
                    @pageChange="pageChange"
                    @sizeChange="sizeChange"
                ></BottomPagination>
            </div>
            <!-- 批量删除对话框 -->
            <a-modal
                title="批量删除"
                :visible="batchDeleteVisible"
                :confirm-loading="batchDeleteConfirmLoading"
                @ok="batchDeleteHandleOk"
                @cancel="batchDeleteHandleCancel"
            >
                <p style="text-align:center;">确认删除？</p>
            </a-modal>
        </div>
    </div>
</template>

<script>
    const columns = [
        {
            title: '序号',
            dataIndex: 'serialNumber',
            key: 'serialNumber',
            align: 'center',
            ellipsis: true,
            width: '80px',
        },
        {
            title: '项目名称',
            dataIndex: 'projectName',
            key: 'projectName',
            scopedSlots: { 
                customRender: 'projectName' 
            },
            align: 'center',
            ellipsis: true,
        },
        {
            title: '结算规则',
            dataIndex: 'rule',
            key: 'rule',
            scopedSlots: { 
                customRender: 'rule' 
            },
            align: 'center',
            ellipsis: true,
            ellipsis: true,
        },
        {
            title: '状态',
            dataIndex: 'ruleStatus',
            key: 'ruleStatus',
            scopedSlots: { 
                customRender: 'ruleStatus' 
            },
            align: 'center',
            ellipsis: true,
            width: '100px',
        },
        {
            title: '类型',
            dataIndex: 'ruleType',
            key: 'ruleType',
            scopedSlots: { 
                customRender: 'ruleType' 
            },
            align: 'center',
            ellipsis: true,
        },
        {
            title: '创建人',
            dataIndex: 'createBy',
            key: 'createBy',
            align: 'center',
            ellipsis: true,
        },
        {
            title: '创建时间',
            dataIndex: 'createTime',
            key: 'createTime',
            align: 'center',
            ellipsis: true,
        },
        {
            title: '修改人',
            dataIndex: 'updateBy',
            key: 'editBy',
            align: 'center',
            ellipsis: true,
        },
        {
            title: '修改时间',
            dataIndex: 'updateTime',
            key: 'editTime',
            align: 'center',
            ellipsis: true,
        },
        {
            title: '备注',
            dataIndex: 'remark',
            key: 'remark',
            align: 'center',
            ellipsis: true,
        },
        { 
            title: '操作', 
            dataIndex: 'action', 
            key: 'action', 
            scopedSlots: { 
                customRender: 'action' 
            },
            align: 'center',
            width: '120px',
        },
    ];

    import TopSelect from '../meter/TopSelect'
    import BottomPagination from '../meter/BottomPagination'
    import { 
        getCheckWork, 
        addCheckWork, 
        editCheckWork, 
        deleteCheckWork, 
        getHeadquarters, 
        getRegion, 
        getCity, 
        getWarehouse, 
        getCustomerName, 
        getOwnerName,
        getLogisticsName,
        getplatformName,
        getShopName,
        getGuaranteedValue,
        getQuerySettlement,
        getRuleDetails,
        putDeleteSettlement,
        putEnableDisableSettlement,
        postNewSettlement,
        putModifySettlement,
        getSettlementRuleExport,
    } from '@/api/api'
    import { downFile } from '@/api/manage'

    export default {
        name: "CheckWorkAccount",
        components: {
            TopSelect,
            BottomPagination,
        },
        data () {
            return {
                data: [],
                columns,
                tableLoading: false,
                selectNumber: 0, // 当前选中数据条数
                selectedRowKeys: [], // 当前选择集合
                deletdBtnShow: false, // 批量删除按钮是否显示
                headquartersId: '', // 总部id
                regionId: undefined, // 大区id
                cityId: undefined, // 城市id
                organizeId: undefined, // 仓库id
                isRegionShow: true,
                isCityShow: true,
                isWareShow: true,
                customerCode : undefined,
                createBy: '', // 创建人
                createTime: [], // 创建时间
                updateBy: '', // 修改人
                updateTime: [], // 修改时间
                createTime_begin: '', // 创建时间开始时间
                createTime_end: '', // 创建时间结束时间
                updateTime_begin: '', // 修改时间开始时间
                updateTime_end: '', // 修改时间结束时间
                dateFormat: 'YYYY-MM-DD HH:mm:ss',
                remark: '',
                pageNo: 1,
                pageSize: 10,
                total: 0,

                code: '',
                key: '',
                regionList: [],
                cityList: [],
                customerList: [],
                warehouseList: [],
                ruleType: undefined, // 规则类型
                moduleType: '',
                projectName: '', // 项目名称
                ruleStatus: undefined, // 规则状态

                visible: false,
                placement: 'right',
                drawerTitle: '新增',
                labelCol: { span: 7 },  
                wrapperCol: { span: 16 },

                exportVisible: false, // 导出
                exportConfirmLoading: false,
                url: {
                    exportUrl: 'report/settlement/rule/exportXls',
                },

                btnDisabled: false,
                isLogisticsCompanyShow: true,
                isPlatformShow: true,
                isShopShow: true,
                isOrderShow: true,
                selectMode: 'default',
                isOrderModel: false,
                form: {
                    organizeId: '', // 仓库id
                    whCode: '',
                    projectName: '',
                    customerCode: '',
                    customerList: [],
                    ownerCode: [],
                    ownerList: [],
                    logisticsCompanyCode: [],
                    logisticsCompanyList: [],
                    platformCode: [],
                    platformList: [],
                    shopCode: [],
                    shopId: '',
                    shopList: [],
                    orderType: [],
                    billingModel: 'piece',
                    ruleType: '',
                    ruleStatus: '',
                    quantityUnit: 'piece',
                    standardRuleStatus: 0,
                    standardRuleInfos: [
                        {
                            quantityBeginValue: '',
                            quantityEndValue: '',
                            quantityUnit: 'piece',
                            rulePrice: '',
                            isCutShow: false,
                            isPlusShow: true,
                            weightRuleStatus: 0,
                        }
                    ],
                    weightRuleShow: true,
                    weightRuleStatus: 0,
                    weightRuleInfos: [
                        {
                            weightRuleType: 'standard',
                            quantity: '',
                            quantityUnit: 'piece',
                            quantityPrice: '',
                        }
                    ],
                    specialRuleStatus: 1,
                    remark: '',
                },
                rules: {
                    projectName: [
                        { required: true, message: '请输入', trigger: 'blur' },
                    ],
                    customerCode: [
                        { required: true, message: '请选择', trigger: 'change' },
                    ],
                    ownerCode: [
                        { required: true, message: '请选择', trigger: 'change' },
                    ],
                    logisticsCompanyCode: [
                        { required: true, message: '请选择', trigger: 'change' },
                    ],
                    platformCode: [
                        { required: true, message: '请选择', trigger: 'change' },
                    ],
                    shopCode: [
                        { required: true, message: '请选择', trigger: 'change' },
                    ],
                    orderType: [
                        { required: true, message: '请选择', trigger: 'change' },
                    ],
                    billingModel: [
                        { required: true, message: '请选择', trigger: 'change' },
                    ]
                },

                ckVisible: false,
                ckDrawerTitle: '新增出库操作费规则',
                ckForm: {
                    organizeId: '', // 仓库id
                    whCode: '',
                    projectName: '',
                    customerCode: '',
                    customerList: [],
                    ownerCode: [],
                    ownerList: [],
                    logisticsCompanyCode: [],
                    logisticsCompanyList: [],
                    platformCode: [],
                    platformList: [],
                    shopCode: [],
                    shopId: '',
                    shopList: [],
                    orderType: [],
                    ruleType: '',
                    ruleStatus: '',
                    // 出库标准规则配置
                    quantityUnit: 'piece',
                    standardSwitchValue: true,
                    isCkStandardShow: true,
                    standardRuleStatus: 0,
                    standardRuleInfos: [
                        {
                            quantityBeginValue: '',
                            quantityEndValue: '',
                            skuBeginValue: '',
                            skuEndValue: '',
                            weightBeginValue: '',
                            weightEndValue: '',
                            quantityUnit: 'piece',
                            rulePrice: '',
                            isCutShow: false,
                            isPlusShow: true,
                            weightRuleStatus: 0,
                        }
                    ],
                    isCkStandardWeightShow: true,
                    standardWeightRuleStatus: 0,
                    standardWeightRuleInfos: [
                        {
                            weightRuleType: 'standard',
                            quantity: '',
                            quantityUnit: 'piece',
                            quantityPrice: '',
                            sku: '',
                            skuPrice: '',
                            weight: '',
                            weightPrice: '',
                        },
                    ],

                    // 出库特殊规则配置
                    specialSwitchValue: true,
                    specialRuleStatus: 1,
                    isCkSpecialShow: true,
                    // 出库冷库配置
                    coldRuleStatus: 0,
                    coldWeightStatus: 0,
                    isCkColdShow: true,
                    coldRuleInfos: [
                        {
                            specialRuleType: 'cold',
                            quantityBeginValue: '',
                            quantityEndValue: '',
                            skuBeginValue: '',
                            skuEndValue: '',
                            weightBeginValue: '',
                            weightEndValue: '',
                            quantityUnit: 'piece',
                            rulePrice: '',
                            isCutShow: false,
                            isPlusShow: true,
                            weightRuleStatus: 0,
                        }
                    ],
                    isCkColdWeightShow: true,
                    coldWeightRuleInfos: [
                        {
                            weightRuleType: 'cold',
                            quantity: '',
                            quantityUnit: 'piece',
                            quantityPrice: '',
                            sku: '',
                            skuPrice: '',
                            weight: '',
                            weightPrice: '',
                        },
                    ],

                    // 出库酒水配置
                    drinksRuleStatus: 0,
                    drinksWeightStatus: 0,
                    isCkDrinksShow: true,
                    drinksRuleInfos: [
                        {
                            specialRuleType: 'drinks',
                            quantityBeginValue: '',
                            quantityEndValue: '',
                            skuBeginValue: '',
                            skuEndValue: '',
                            weightBeginValue: '',
                            weightEndValue: '',
                            quantityUnit: 'piece',
                            rulePrice: '',
                            isCutShow: false,
                            isPlusShow: true,
                            weightRuleStatus: 0,
                        }
                    ],
                    isCkDrinksWeightShow: true,
                    drinksWeightRuleInfos: [
                        {
                            weightRuleType: 'drinks',
                            quantity: '',
                            quantityUnit: 'piece',
                            quantityPrice: '',
                            sku: '',
                            skuPrice: '',
                            weight: '',
                            weightPrice: '',
                        }
                    ],
                    remark: '',
                },
                ckRules: {
                    projectName: [
                        { required: true, message: '请输入', trigger: 'blur' },
                    ],
                    customerCode: [
                        { required: true, message: '请选择', trigger: 'change' },
                    ],
                    ownerCode: [
                        { required: true, message: '请选择', trigger: 'change' },
                    ],
                    logisticsCompanyCode: [
                        { required: true, message: '请选择', trigger: 'change' },
                    ],
                    platformCode: [
                        { required: true, message: '请选择', trigger: 'change' },
                    ],
                    shopCode: [
                        { required: true, message: '请选择', trigger: 'change' },
                    ],
                    orderType: [
                        { required: true, message: '请选择', trigger: 'change' },
                    ],
                },

                validStatus: true, // 当前表单验证状态，true表示成功，false表示失败
                ckValidStatus: true, // 出库表单验证状态

                editVisible: false, // 确认删除对话框
                batchDeleteVisible: false, // 批量删除
                batchDeleteConfirmLoading: false,
                regionList: [],
                cityList: [],
                warehouseList: [],
                regionName: '', // 大区名称
                cityName: '', // 城市名称
                warehouseName: '', // 仓库名称
                addMode: true,
                id: '',
                ids: '',
            }
        },
        created() {
            this.getHeadquartersList()
        },
        methods: {
            
            // select选择
            handleChange(value) {
                console.log(`selected ${value}`);
            },
            // 选择框过滤
            filterOption(input, option) {
                return (
                    option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
                );
            },
            // 搜索
            onSearch() {
                if( (this.regionId == '' || this.regionId == undefined) || (this.cityId == '' || this.cityId == undefined) || (this.organizeId == '' || this.organizeId == undefined) ){
                    this.$message.warning('搜索时必须先选择大区、城市和仓库！')
                }else{
                    this.pageNo = 1
                    this.getGuaranteedValue()
                }
                
            },
            // 重置
            onReset() {
                this.regionId = undefined
                this.cityId = undefined
                this.organizeId = undefined
                this.cityList = []
                this.warehouseList = []
                this.projectName = ''
                this.ruleType = undefined
                this.ruleStatus = undefined
                this.createBy = ''
                this.createTime = []
                this.updateBy = ''
                this.updateTime = []
                this.createTime_begin = ''
                this.createTime_end = ''
                this.updateTime_begin = ''
                this.updateTime_end = ''
                this.pageSize = 10
                this.pageNo = 1
                this.total = 0
                this.data = []
                this.selectNumber = 0
                this.selectedRowKeys = []
                this.deletdBtnShow = false
                this.customerCode = undefined
                this.customerList = []
            },
            // 新增选择规则类型
            handleMenuClick(e) {
                this.key = e.key

                this.btnDisabled = false

                // 订单类型模式
                if(this.key == 'RK'){
                    this.selectMode = 'default'
                }else{
                    this.selectMode = 'multiple'
                }

                if( (this.regionId == '' || this.regionId == undefined) || (this.cityId == '' || this.cityId == undefined) || (this.organizeId == '' || this.organizeId == undefined) ){
                    this.$message.warning('新增时必须先选择大区、城市和仓库！')
                }else{
                    this.visible = true
                    this.addMode = true

                    // 新增清空输入框
                    this.form.projectName = ''
                    this.form.customerCode = undefined
                    this.form.ownerCode = undefined
                    this.form.ownerList = []
                    this.form.logisticsCompanyCode = undefined
                    this.form.logisticsCompanyList = []
                    this.form.platformCode = undefined
                    this.form.platformList = []
                    this.form.shopCode = undefined
                    this.form.shopList = []
                    this.form.orderType = undefined
                    this.form.standardRuleInfos = [
                        {
                            quantityBeginValue: '',
                            quantityEndValue: '',
                            quantityUnit: 'piece',
                            rulePrice: '',
                            weightRuleStatus: 0,
                            isCutShow: false,
                            isPlusShow: true,
                        }
                    ]
                    this.form.weightRuleStatus = 0
                    this.form.weightRuleShow = true
                    this.form.weightRuleInfos = [
                        {
                            weightRuleType: 'standard',
                            quantity: '',
                            quantityUnit: 'piece',
                            quantityPrice: '',
                        }
                    ]
                    this.form.remark = ''

                    // 默认是按单计费
                    this.isOrderModel = true
                    
                    if(this.key == 'RK'){
                        this.drawerTitle = '新增入库操作费规则'
                        this.isLogisticsCompanyShow = false
                        this.isPlatformShow = false
                        this.isShopShow = false
                        this.isOrderShow = true
                    }else if(this.key == 'ZPTF'){
                        this.drawerTitle = '新增赠品投放费规则'
                        this.isLogisticsCompanyShow = false
                        this.isPlatformShow = true
                        this.isShopShow = true
                        this.isOrderShow = true
                    }else if(this.key == 'DBCK'){
                        this.drawerTitle = '调拨出库费规则'
                        this.isLogisticsCompanyShow = false
                        this.isPlatformShow = false
                        this.isShopShow = false
                        this.isOrderShow = false

                        // 新增默认为按件计费
                        this.form.billingModel = 'piece'
                        this.isOrderModel = false
                        this.$forceUpdate()

                    }else if(this.key == 'DDLJ'){
                        this.drawerTitle = '新增订单拦截费规则'
                        this.isLogisticsCompanyShow = false
                        this.isPlatformShow = true
                        this.isShopShow = true
                        this.isOrderShow = false
                    }else if(this.key == 'CK'){
                        this.drawerTitle = '新增出库操作费规则'
                        this.visible = false
                        this.ckVisible = true

                        // 新增清空输入框
                        this.ckForm.projectName = ''
                        this.ckForm.customerCode = undefined
                        this.ckForm.ownerCode = undefined
                        this.ckForm.ownerList = []
                        this.ckForm.logisticsCompanyCode = undefined
                        this.ckForm.logisticsCompanyList = []
                        this.ckForm.platformCode = undefined
                        this.ckForm.platformList = []
                        this.ckForm.shopCode = undefined
                        this.ckForm.shopList = []
                        this.ckForm.orderType = undefined
                        this.ckForm.remark = ''

                        this.ckForm.standardSwitchValue = true
                        this.ckForm.standardRuleInfos = [
                            {
                                quantityBeginValue: '',
                                quantityEndValue: '',
                                skuBeginValue: '',
                                skuEndValue: '',
                                weightBeginValue: '',
                                weightEndValue: '',
                                quantityUnit: 'piece',
                                rulePrice: '',
                                isCutShow: false,
                                isPlusShow: true,
                                weightRuleStatus: 0,
                            }
                        ]
                        this.ckForm.isCkStandardShow = true

                        this.ckForm.standardRuleStatus = 0
                        this.ckForm.standardWeightRuleInfos = [
                            {
                                weightRuleType: 'standard',
                                quantity: '',
                                quantityUnit: 'piece',
                                quantityPrice: '',
                                sku: '',
                                skuPrice: '',
                                weight: '',
                                weightPrice: '',
                            },
                        ]
                        this.ckForm.isCkStandardWeightShow = true

                        this.ckForm.specialSwitchValue = false
                        this.ckForm.isCkSpecialShow = false
                        this.ckForm.coldRuleInfos = [
                            {
                                specialRuleType: 'cold',
                                quantityBeginValue: '',
                                quantityEndValue: '',
                                skuBeginValue: '',
                                skuEndValue: '',
                                weightBeginValue: '',
                                weightEndValue: '',
                                quantityUnit: 'piece',
                                rulePrice: '',
                                isCutShow: false,
                                isPlusShow: true,
                                weightRuleStatus: 0,
                            }
                        ]
                        this.ckForm.isCkColdShow = true


                        this.ckForm.coldWeightRuleInfos = [
                            {
                                weightRuleType: 'cold',
                                quantity: '',
                                quantityUnit: 'piece',
                                quantityPrice: '',
                                sku: '',
                                skuPrice: '',
                                weight: '',
                                weightPrice: '',
                            },
                        ]
                        this.ckForm.isCkColdWeightShow = true

                        this.ckForm.drinksRuleInfos = [
                            {
                                specialRuleType: 'drinks',
                                quantityBeginValue: '',
                                quantityEndValue: '',
                                skuBeginValue: '',
                                skuEndValue: '',
                                weightBeginValue: '',
                                weightEndValue: '',
                                quantityUnit: 'piece',
                                rulePrice: '',
                                isCutShow: false,
                                isPlusShow: true,
                                weightRuleStatus: 0,
                            }
                        ]
                        this.ckForm.isCkDrinksShow = true

                        this.ckForm.drinksWeightRuleInfos = [
                            {
                                weightRuleType: 'drinks',
                                quantity: '',
                                quantityUnit: 'piece',
                                quantityPrice: '',
                                sku: '',
                                skuPrice: '',
                                weight: '',
                                weightPrice: '',
                            }
                        ]
                        this.ckForm.isCkDrinksWeightShow = true

                    }
                    // 调用设置删除和添加按钮显示隐藏
                    this.setCutPlus()
                    this.ckStandardSetCutPlus()
                    this.ckColdSetCutPlus()
                    this.ckDrinksSetCutPlus()
                    
                    // 只有验证失败，新增的时候才重置验证状态
                    if(this.validStatus === false) {
                        this.$refs.ruleForm.resetFields()
                    }
                    if(this.ckValidStatus === false) {
                        this.$refs.ckRuleForm.resetFields()
                    }
                }
            },
            // 获取结算规则配置列表数据接口
            getGuaranteedValue(){
                let params = {
                    organizeId: this.organizeId,
                    customerCode: this.customerCode,
                    ruleType: this.ruleType,
                    projectName: this.projectName,
                    ruleStatus: this.ruleStatus,
                    createBy: this.createBy,
                    createTime_begin: this.createTime_begin,
                    createTime_end: this.createTime_end,
                    updateBy: this.updateBy,
                    updateTime_begin: this.updateTime_begin,
                    updateTime_end: this.updateTime_end,
                    remark: this.remark,
                    pageNo: this.pageNo,
                    pageSize: this.pageSize,
                    delFlag: 0,
                }
                this.tableLoading = true
                getQuerySettlement(params).then((res)=>{
                    this.tableLoading = false
                    if(res.success){
                        // 获取列表成功清空勾选状态
                        this.selectNumber = 0
                        this.selectedRowKeys = []
                        this.deletdBtnShow = false

                        // 序号
                        for(var i=0; i<res.result.records.length; i++){
                            res.result.records[i].serialNumber = i+1
                        }
                        this.data = res.result.records
                        this.total = res.result.total
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            },
            
            // 选中
            onSelectChange(selectedRowKeys) {
                this.selectedRowKeys = selectedRowKeys
                this.selectNumber = selectedRowKeys.length
                if(this.selectedRowKeys.length > 0){
                    this.deletdBtnShow = true
                }else{
                    this.deletdBtnShow = false
                }
            },
            // 清空选中
            clearSelect() {
                this.selectNumber = 0
                this.selectedRowKeys = []
                this.deletdBtnShow = false
            },
            // 获取总部
            getHeadquartersList(){
                let params = {}
                getHeadquarters(params).then((res)=>{
                    if(res.success){
                        this.headquartersId = res.result.organizeOrgList[0].id
                        this.getRegionList()
                    }
                })
            },
            // 获取大区
            getRegionList(){
                let params = {id: this.headquartersId}
                getRegion(params).then((res)=>{
                    if(res.success){
                        this.regionList = res.result.organizeOrgList
                        if(this.regionList.length === 1){
                            this.regionId = this.regionList[0].id
                            this.getCityList()
                        }
                    }else{
                        this.$message.warning(res.message, 6)
                    }
                })
            },
            // 选择大区
            regionChange(value){
                this.regionId = value 
                this.cityId = undefined
                this.organizeId = undefined
                this.customerCode = undefined
                this.customerList = []
                this.cityList = []
                this.warehouseList = []
                this.getCityList()
            },
            // 获取城市
            getCityList(){
                let params = {
                    areaIds: this.regionId
                }
                getCity(params).then((res)=>{
                    if(res.success){
                        this.cityList = res.result.organizeOrgList
                        if(this.cityList.length === 1){
                            this.cityId = this.cityList[0].id
                            this.getWarehouseList()
                        }
                    }
                })
            },
            // 选择城市
            cityChange(value){
                this.cityId = value
                this.organizeId = undefined
                this.customerCode = undefined
                this.customerList = []
                this.warehouseList = []
                this.getWarehouseList()
                
            },
            // 获取仓库
            getWarehouseList(){
                let params = {
                    cityIds: this.cityId
                }
                getWarehouse(params).then((res)=>{
                    if(res.success){
                        this.warehouseList = res.result.organizeOrgList
                        if(this.warehouseList.length === 1){
                            this.organizeId = this.warehouseList[0].id
                            this.code = this.warehouseList[0].code
                            this.getCustomerName()
                        }
                    }
                })
            },
            // 选择仓库
            warehouseChange(value){
                this.organizeId = value
                for(let item of this.warehouseList) {
                    if(item.id === this.organizeId) {
                        this.code = item.code
                        this.customerCode = undefined
                        this.customerList = []
                        this.ownerCode = undefined
                        this.ownerList = []
                        this.getCustomerName()
                    }
                }
            },
            
            // 获取当前页数、条数
            pageChange(data1, data2) {
                this.pageNo = data1
                this.pageSize = data2
                this.getGuaranteedValue()
            },
            // 获取当前页数、条数
            sizeChange(data1, data2) {
                this.pageNo = data1
                this.pageSize = data2
                this.getGuaranteedValue()
            },
            // 创建时间
            createChange(value, dateString) {
                this.createTime = value
                this.createTime_begin = dateString[0]
                this.createTime_end = dateString[1]
            },
            createOk(value) {
                console.log('onOk: ', value);
            },
            // 修改时间
            editChange(value, dateString) {
                this.updateTime = value
                this.updateTime_begin = dateString[0]
                this.updateTime_end = dateString[1]
            },
            editOk(value) {
                console.log('onOk: ', value);
            },
            
            onClose() {
                this.visible = false;
            },

            // 查看
            doLook(record) {
                this.btnDisabled = true

                this.editDrawer(record)

                // 只有验证失败，新增的时候才重置验证状态
                if(this.validStatus === false) {
                    this.$refs.ruleForm.resetFields()
                }
                if(this.ckValidStatus === false) {
                    this.$refs.ckRuleForm.resetFields()
                }
            },
            // 修改
            doEdit(record) {
                this.btnDisabled = false

                this.editDrawer(record)

                // 只有验证失败，新增的时候才重置验证状态
                if(this.validStatus === false) {
                    this.$refs.ruleForm.resetFields()
                }
                if(this.ckValidStatus === false) {
                    this.$refs.ckRuleForm.resetFields()
                }
            },
            // 获取结算规则
            getRule(record) {
                // 标准规则
                var standardString = '标准规则:'
                if(record.standardRuleInfo && record.standardRuleInfo.standardRuleInfos && record.standardRuleInfo.standardRuleInfos.length > 0){
                    if(record.ruleType == 'DBCK'){
                        if(record.billingModel == 'order'){
                            for(var item of record.standardRuleInfo.standardRuleInfos){
                                standardString += '数量区间:>='+ item.quantityBeginValue + '<=' + item.quantityEndValue + ';规则价格:' + item.rulePrice + ';'
                            }
                        }else{
                            standardString = ''
                            for(var item of record.standardRuleInfo.standardRuleInfos){
                                standardString += '规则价格:' + item.rulePrice + ';'
                            }
                        }
                    }else if(record.ruleType == 'CK'){
                        for(var item of record.standardRuleInfo.standardRuleInfos){
                            standardString += '数量区间:>=' + item.quantityBeginValue + '<=' + item.quantityEndValue + ';SKU类数:>=' + item.skuBeginValue + "<=" + item.skuEndValue + ';重量区间(kg):' + '>=' +item.weightBeginValue + '<=' + item.weightEndValue + ';规则价格:' + item.rulePrice + ';'
                        }
                    }else{
                        for(var item of record.standardRuleInfo.standardRuleInfos){
                            standardString += '数量区间:>='+ item.quantityBeginValue + '<=' + item.quantityEndValue + ';规则价格:' + item.rulePrice + ';'
                        }
                    }
                    
                }else{
                    standardString = ''
                }

                // 续重规则
                var standardWeightString = ''
                if(record.standardRuleInfo && record.standardRuleInfo.weightRuleInfo){
                    var info = record.standardRuleInfo.weightRuleInfo

                    if(record.ruleType == 'CK'){
                        standardWeightString = '续重规则:数量' + info.quantity + ';规则价格:' + info.quantityPrice + ';SKU类数:' + info.sku + ';规则价格:' + info.skuPrice + ';重量:' + info.weight + ';规则价格:' + info.weightPrice
                    }else{
                        if(record.ruleType == 'DBCK'){
                            if(record.billingModel == 'order'){
                                standardWeightString = '续重规则:数量' + info.quantity + ';规则价格:' + info.quantityPrice + ';'
                            }else{
                                standardWeightString = ''
                            }
                        }else{
                            standardWeightString = '续重规则:数量' + info.quantity + ';规则价格:' + info.quantityPrice + ';'
                        }
                        
                    }
                    
                }else{
                    standardWeightString = ''
                }

                var coldString = ''
                var drinksString = ''
                if(record.specialRuleInfo && record.specialRuleInfo.specialRuleInfos && record.specialRuleInfo.specialRuleInfos.length > 0){
                    var cList = []
                    var dList = []
                    for(var item of record.specialRuleInfo.specialRuleInfos){
                        if(item.specialRuleType == 'cold'){
                            cList.push(item)
                        }
                        if(item.specialRuleType == 'drinks'){
                            dList.push(item)
                        }
                    }
                    // 冷库规则
                    if(cList.length > 0){
                        coldString = '冷库:'
                        for(var item of cList){
                            coldString += '数量区间:>='+ item.quantityBeginValue + '<=' + item.quantityEndValue + ';SKU类数:>=' + item.skuBeginValue + "<=" + item.skuEndValue + ';重量区间(kg):' + '>=' +item.weightBeginValue + '<=' + item.weightEndValue + ';规则价格:' + item.rulePrice + ';'
                        }
                    }else{
                        coldString = ''
                    }
                    // 酒水规则
                    if(dList.length > 0){
                        drinksString = '酒水:'
                        for(var item of dList){
                            drinksString += '数量区间:>='+ item.quantityBeginValue + '<=' + item.quantityEndValue + ';SKU类数:>=' + item.skuBeginValue + "<=" + item.skuEndValue + ';重量区间(kg):' + '>=' +item.weightBeginValue + '<=' + item.weightEndValue + ';规则价格:' + item.rulePrice + ';'
                        }
                    }else{
                        drinksString = ''
                    }
                }

                var coldWeightString = ''
                var drinksWeightString = ''
                if(record.specialRuleInfo && record.specialRuleInfo.weightRuleInfos && record.specialRuleInfo.weightRuleInfos.length > 0){
                    var cWeightList = []
                    var dWeightList = []
                    for(var item of record.specialRuleInfo.weightRuleInfos){
                        if(item.weightRuleType == 'cold'){
                            cWeightList.push(item)
                        }
                        if(item.weightRuleType == 'drinks'){
                            dWeightList.push(item)
                        }
                    }
                    // 冷库续重规则
                    if(cWeightList.length > 0){
                        coldWeightString = '冷库续重:数量' + cWeightList[0].quantity + ';规则价格:' + cWeightList[0].quantityPrice + ';SKU类数:' + cWeightList[0].sku + ';规则价格:' + cWeightList[0].skuPrice + ';重量:' + cWeightList[0].weight + ';规则价格:' + cWeightList[0].weightPrice
                    }else{
                        coldWeightString = ''
                    }
                    // 酒水续重规则
                    if(dWeightList.length > 0){
                        drinksWeightString = '酒水续重:数量' + dWeightList[0].quantity + ';规则价格:' + dWeightList[0].quantityPrice + ';SKU类数:' + dWeightList[0].sku + ';规则价格:' + dWeightList[0].skuPrice + ';重量:' + dWeightList[0].weight + ';规则价格:' + dWeightList[0].weightPrice
                    }else{
                        drinksWeightString = ''
                    }
                }
                
                if(record.ruleType == 'CK'){
                    
                    var list = record.orderType.split(',')
                    var orderString = '订单类型:'
                    var typeString = ''
                    for(var item of list){
                        if(item == 'hl'){
                            typeString = '合流'
                        }else if(item == 'multi'){
                            typeString = '多件'
                        }else if(item == 'single'){
                            typeString = '单件'
                        }else{
                            typeString = '其他'
                        }
                        orderString += typeString + ','
                    }

                    return `客户:${record.customerName};货主:${record.ownerName};物流公司:${record.logisticsCompanyName};平台:${record.platformName};店铺:${record.shopName}; ${orderString} ${standardString} ${standardWeightString} ${coldString} ${coldWeightString} ${drinksString} ${drinksWeightString}`
                }else{
                    if(record.ruleType == 'RK'){
                        return `客户:${record.customerName};货主:${record.ownerName}; ${standardString} ${standardWeightString}`
                    }else if(record.ruleType == 'ZPTF'){

                        var list = record.orderType.split(',')
                    var orderString = '订单类型:'
                    var typeString = ''
                    for(var item of list){
                        if(item == 'db'){
                            typeString = '调拨'
                        }else if(item == 'hl'){
                            typeString = '合流'
                        }else if(item == 'multi'){
                            typeString = '多件'
                        }else if(item == 'single'){
                            typeString = '单件'
                        }else{
                            typeString = '其他'
                        }
                        orderString += typeString + ','
                    }

                        return `客户:${record.customerName};货主:${record.ownerName};平台:${record.platformName};店铺:${record.shopName}; ${orderString} ${standardString} ${standardWeightString}`
                    }else if(record.ruleType == 'DBCK'){
                        if(record.billingModel == 'piece'){
                            var model = '计费模式:按件计费;'
                        }else if(record.billingModel == 'box'){
                            var model = '计费模式:按箱计费;'
                        }else{
                            var model = '计费模式:按单计费;'
                        }
                        return `客户:${record.customerName};货主:${record.ownerName};${model} ${standardString} ${standardWeightString}`
                    }else{
                        return `客户:${record.customerName};货主:${record.ownerName};平台:${record.platformName};店铺:${record.shopName}; ${standardString} ${standardWeightString}`
                    }
                    
                }
                
            },
            // 获取类型
            getRuleType(record) {
                if(record.ruleType == 'RK'){
                    if(record.orderType == 'CGRK'){
                        return '入库操作费规则-采购入库'
                    }else if(record.orderType == 'THRK'){
                        return '入库操作费规则-退货入库'
                    }else if(record.orderType == 'DBRK'){
                        return '入库操作费规则-调拨入库'
                    }else{
                        return '入库操作费规则-其他入库'
                    }  
                }else if(record.ruleType == 'ZPTF'){
                    return '赠品投放费规则'
                }
                else if(record.ruleType == 'DBCK'){
                    return '调拨出库费规则'
                }
                else if(record.ruleType == 'DDLJ'){
                    return '订单拦截费规则'
                }else{
                    return '出库操作费规则'
                }
            },
            // 修改收支项
            editDrawer(record) {
                let params = {
                    ruleId: record.id
                }
                getRuleDetails(params).then((res)=>{
                    if(res.success){
                        this.addMode = false
                        this.id = record.id
                        this.visible = true

                        // 订单类型模式
                        if(record.ruleType == 'RK'){
                            this.selectMode = 'default'
                        }else{
                            this.selectMode = 'multiple'
                        }

                        // 默认是按单计费
                        this.isOrderModel = true

                        if(record.ruleType == 'RK'){
                            this.drawerTitle = '修改入库操作费规则'
                            this.isLogisticsCompanyShow = false
                            this.isPlatformShow = false
                            this.isShopShow = false
                            this.isOrderShow = true
                        }else if(record.ruleType == 'ZPTF'){
                            this.drawerTitle = '修改赠品投放费规则'
                            this.isLogisticsCompanyShow = false
                            this.isPlatformShow = true
                            this.isShopShow = true
                            this.isOrderShow = true
                        }else if(record.ruleType == 'DBCK'){
                            this.drawerTitle = '修改调拨出库费规则'
                            this.isLogisticsCompanyShow = false
                            this.isPlatformShow = false
                            this.isShopShow = false
                            this.isOrderShow = false
                        }else if(record.ruleType == 'DDLJ'){
                            this.drawerTitle = '修改订单拦截费规则'
                            this.isLogisticsCompanyShow = false
                            this.isPlatformShow = true
                            this.isShopShow = true
                            this.isOrderShow = false
                        }else if(record.ruleType == 'CK'){
                            this.ckDrawerTitle = '修改出库操作费规则'
                            this.visible = false
                            this.ckVisible = true
                        }

                        this.key = record.ruleType
                        // 修改赋值
                        
                        if(record.ruleType == 'CK'){ // 出库模块
                            this.ckForm.projectName = record.projectName
                            this.ckForm.customerCode = record.customerCode
                            this.ckForm.ownerCode = record.ownerCode?record.ownerCode.split(','):[]
                            this.ckForm.logisticsCompanyCode = record.logisticsCompanyCode?record.logisticsCompanyCode.split(','):[]
                            this.ckForm.platformCode = record.platformCode?record.platformCode.split(','):[]
                            this.ckForm.shopCode = record.shopCode?record.shopCode.split(','):[]
                            this.ckForm.orderType = record.orderType?record.orderType.split(','):[]
                            this.ckForm.ruleStatus = record.ruleStatus
                            this.ckForm.remark = record.remark

                            this.getOwnerName()
                            this.getLogisticsName()
                            this.getplatformName()
                            this.getShopName()
                            
                            this.ckForm.standardRuleStatus = record.standardRuleStatus
                            if(this.ckForm.standardRuleStatus == 0){
                                this.ckForm.standardSwitchValue = true
                            }else{
                                this.ckForm.standardSwitchValue = false
                            }

                            if(res.result.standardRuleInfos && res.result.standardRuleInfos.length > 0){
                                this.ckForm.standardRuleInfos = res.result.standardRuleInfos
                                this.ckForm.isCkStandardShow = true
                                // this.ckForm.standardSwitchValue = true  

                                // 设置单位
                                this.ckForm.quantityUnit = res.result.standardRuleInfos[0].quantityUnit

                            }else{
                                this.ckForm.isCkStandardShow = false
                                // this.ckForm.standardSwitchValue = false
                            }

                            this.ckForm.specialRuleStatus = record.specialRuleStatus
                            if(this.ckForm.specialRuleStatus == 0){
                                this.ckForm.specialSwitchValue = true
                            }else{
                                this.ckForm.specialSwitchValue = false
                            }

                            if(record.specialRuleStatus == 0){
                                // this.ckForm.specialSwitchValue = true
                                this.ckForm.isCkSpecialShow = true
                            }else{
                                // this.ckForm.specialSwitchValue = false
                                this.ckForm.isCkSpecialShow = false
                            }

                            if(res.result.specialRuleInfos && res.result.specialRuleInfos.length > 0){
                                // 设置单位
                                this.ckForm.quantityUnit = res.result.specialRuleInfos[0].quantityUnit
                            }
                            
                            var coldList = []
                            var drinksList = []
                            for(var item of res.result.specialRuleInfos){
                                if(item.specialRuleType == 'cold'){
                                    coldList.push(item)
                                }
                                if(item.specialRuleType == 'drinks'){
                                    drinksList.push(item)
                                }
                            }
                            if(coldList.length > 0){
                                this.ckForm.coldRuleInfos = coldList
                                this.ckForm.isCkColdShow = true
                                this.ckForm.coldRuleStatus = 0
                            }else{
                                this.ckForm.isCkColdShow = false
                                this.ckForm.isCkColdWeightShow = false
                                this.ckForm.coldRuleStatus = 1
                                this.ckForm.coldWeightStatus = 1
                            }

                            if(drinksList.length > 0){
                                this.ckForm.drinksRuleInfos = drinksList
                                this.ckForm.isCkDrinksShow = true
                                this.ckForm.drinksRuleStatus = 0
                            }else{
                                this.ckForm.isCkDrinksShow = false
                                this.ckForm.isCkDrinksWeightShow = false
                                this.ckForm.drinksRuleStatus = 1
                                this.ckForm.drinksWeightStatus = 1
                            }
                            
                            var sList = []
                            var cList = []
                            var dList = []
                            for(var item of res.result.weightRuleInfos){
                                if(item.weightRuleType == 'standard'){
                                    sList.push(item)
                                }
                                if(item.weightRuleType == 'cold'){
                                    cList.push(item)
                                }
                                if(item.weightRuleType == 'drinks'){
                                    dList.push(item)
                                }
                            }

                            if(sList.length > 0){
                                this.ckForm.standardWeightRuleInfos = sList
                                this.ckForm.isCkStandardWeightShow = true

                                if(this.ckForm.standardRuleInfos.length > 0){
                                    for(var item of this.ckForm.standardRuleInfos){
                                        item.weightRuleStatus = 0
                                    }
                                }
                            }else{
                                this.ckForm.isCkStandardWeightShow = false
                                
                                if(this.ckForm.standardRuleInfos.length > 0){
                                    for(var item of this.ckForm.standardRuleInfos){
                                        item.weightRuleStatus = 1
                                    }
                                }
                            }
                            
                            if(cList.length > 0){
                                this.ckForm.coldWeightRuleInfos = cList
                                this.ckForm.isCkColdWeightShow = true
                                this.ckForm.coldWeightStatus = 0
                            }else{
                                this.ckForm.isCkColdWeightShow = false
                                this.ckForm.coldWeightStatus = 1
                            }
                            
                            if(dList.length > 0){
                                this.ckForm.drinksWeightRuleInfos = dList
                                this.ckForm.isCkDrinksWeightShow = true
                                this.ckForm.DrinksWeightStatus = 0
                            }else{
                                this.ckForm.isCkDrinksWeightShow = false
                                this.ckForm.DrinksWeightStatus = 1
                            }
                            
                            // 重置按钮状态
                            this.ckStandardSetCutPlus()
                            this.ckColdSetCutPlus()
                            this.ckDrinksSetCutPlus()
                            
                        }else{ // 其他模块
                            this.form.projectName = record.projectName
                            this.form.customerCode = record.customerCode
                            this.form.ownerCode = record.ownerCode?record.ownerCode.split(','):[]
                            this.form.LogisticsCompanyCode = record.LogisticsCompanyCode?record.LogisticsCompanyCode.split(','):[]
                            this.form.platformCode = record.platformCode?record.platformCode.split(','):[]
                            this.form.shopCode = record.shopCode?record.shopCode.split(','):[]
                            this.form.orderType = record.orderType?record.orderType.split(','):[]
                            this.form.ruleStatus = record.ruleStatus
                            this.form.remark = record.remark
                            this.form.standardRuleStatus = record.standardRuleStatus
                            this.form.standardRuleInfos = res.result.standardRuleInfos

                            this.getOwnerName()
                            this.getLogisticsName()
                            this.getplatformName()
                            this.getShopName()

                            // 设置单位
                            this.form.quantityUnit = res.result.standardRuleInfos[0].quantityUnit

                            // 调用设置删除和添加按钮显示隐藏
                            this.setCutPlus()

                            if(res.result.standardRuleInfos && res.result.standardRuleInfos.length > 0){
                                this.form.weightRuleStatus = res.result.standardRuleInfos[0].weightRuleStatus
                                if(this.form.weightRuleStatus == 0){
                                    this.form.weightRuleShow = true
                                }else{
                                    this.form.weightRuleShow = false
                                }
                            }
                            
                            this.form.weightRuleInfos = res.result.weightRuleInfos
                            this.form.specialRuleStatus = record.specialRuleStatus
                            this.form.specialRuleInfos = res.result.specialRuleInfos

                            if(record.billingModel){
                                this.form.billingModel = record.billingModel
                                if(this.form.billingModel == 'order'){
                                    this.isOrderModel = true
                                }else{
                                    this.isOrderModel = false
                                }
                                this.$forceUpdate()
                            }
                        }
                        // 赋值
                        
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            },
            // 续重规则配置状态
            weightRuleStatusChange(e) {
                this.form.weightRuleShow = e.target.value
                if(e.target.value == 0){
                    this.form.weightRuleShow = true
                    this.form.weightRuleInfos = [
                        {
                            weightRuleType: 'standard',
                            quantity: '',
                            quantityUnit: this.form.quantityUnit,
                            quantityPrice: '',
                        }
                    ]
                }else{
                    this.form.weightRuleShow = false
                    // this.form.weightRuleInfos = []
                }
            },
            
            // 删除规则
            cutRule(index) {
                this.form.standardRuleInfos.splice(index, 1)
                this.setCutPlus()
            },
            // 添加规则
            plusRule() {
                this.form.standardRuleInfos.push(
                    {
                        quantityBeginValue: '',
                        quantityEndValue: '',
                        quantityUnit: this.form.quantityUnit,
                        rulePrice: '',
                        weightRuleStatus: 0,
                        isCutShow: true,
                        isPlusShow: true,
                    }
                )
                this.setCutPlus()
            },
            // 设置删除和添加按钮显示隐藏
            setCutPlus() {
                var list = this.form.standardRuleInfos
                if(list.length == 1){
                    list[0].isCutShow = false
                    list[0].isPlusShow = true
                }else if(list.length > 1){
                    for(var item of list){
                        item.isCutShow = true
                        item.isPlusShow = false
                    }
                    list[list.length-1].isPlusShow = true
                }
                
                // 查看时隐藏删除添加按钮
                if(this.btnDisabled){
                    for(var item of list){
                        item.isCutShow = false
                        item.isPlusShow = false
                    }
                }

                this.form.standardRuleInfos = list
                this.$forceUpdate()
            },
            // 标准单位选择
            standardUnitChange(value) {
                this.form.quantityUnit = value

                for(var item of this.form.standardRuleInfos){
                    item.quantityUnit = value
                }
                this.form.weightRuleInfos[0].quantityUnit = value
            },
            // 续重单位选择
            weightUnitChange(value) {
                this.form.weightRuleInfos[0].quantityUnit = value
            },
            // 计费模式
            billingModelChange(value) {
                
                this.form.billingModel = value
                if(this.form.billingModel == 'order'){
                    this.isOrderModel = true
                }else{
                    this.isOrderModel = false
                }
                
                this.form.standardRuleInfos = [
                    {
                        quantityBeginValue: '',
                        quantityEndValue: '',
                        quantityUnit: 'piece',
                        rulePrice: '',
                        weightRuleStatus: 0,
                        isCutShow: false,
                        isPlusShow: true,
                    }
                ]

                this.form.weightRuleStatus = 0
                this.form.weightRuleShow = true
                this.form.weightRuleInfos = [
                    {
                        weightRuleType: 'standard',
                        quantity: '',
                        quantityUnit: this.form.quantityUnit,
                        quantityPrice: '',
                    }
                ]

                this.$forceUpdate()

            },
            // 表单
            onSubmit() {
                this.$refs.ruleForm.validate(valid => {
                    if (valid) {
                        this.validStatus = true

                        // 添加模块类型
                        if(this.key == 'RK'){
                            this.moduleType = 'input'
                        }else{
                            this.moduleType = 'output'
                        }

                        // 数量区间验证
                        if(this.isOrderModel) {
                            for(var item of this.form.standardRuleInfos){
                                if(( (item.quantityBeginValue == '' && item.quantityBeginValue != 0) || item.quantityBeginValue == null) || ( (item.quantityEndValue == '' && item.quantityEndValue != 0) || item.quantityEndValue == null) || ( (item.rulePrice == '' && item.rulePrice != 0) || (item.rulePrice == '' || item.rulePrice == null))){
                                    this.$message.warning('请填写数量区间和规则价格！')
                                    return
                                }
                                if(item.quantityBeginValue >= item.quantityEndValue){
                                    this.$message.warning('请填写正确的数量区间！')
                                    return
                                }
                            }
                            
                            if(this.form.standardRuleInfos.length >= 2){

                                for(var i=0;i<this.form.standardRuleInfos.length-1;i++){
                                    if(this.form.standardRuleInfos[i].quantityEndValue >= this.form.standardRuleInfos[i+1].quantityBeginValue){
                                        this.$message.warning('请填写正确的数量区间！')
                                        return
                                    }
                                }
                            }
                            
                            // 续重规则验证
                            if(this.form.weightRuleStatus == 0){

                                if( (this.form.weightRuleInfos[0].quantity == '' || this.form.weightRuleInfos[0].quantity == null) || (this.form.weightRuleInfos[0].quantityPrice == '' || this.form.weightRuleInfos[0].quantityPrice == null) ){
                                    this.$message.warning('请填写续重规则数量和规则价格！')
                                    return
                                }
                                for(var item of this.form.standardRuleInfos){
                                    item.weightRuleStatus = 0
                                }
                            }else{
                                for(var item of this.form.standardRuleInfos){
                                    item.weightRuleStatus = 1
                                }
                                this.form.weightRuleInfos = []
                            }

                            if(this.form.weightRuleInfos.length > 0){
                                this.form.weightRuleInfos[0].weightRuleType = 'standard'
                            }
                        }else{
                            for(var item of this.form.standardRuleInfos){
                                if(( (item.rulePrice == '' && item.rulePrice != 0) || (item.rulePrice == '' || item.rulePrice == null) )){
                                    this.$message.warning('请填写规则价格！')
                                    return
                                }
                                
                            }
                        }
                        

                        // 添加sortNo字段
                        if(this.form.standardRuleInfos.length > 0){
                            for(var i=0;i<this.form.standardRuleInfos.length;i++){
                                this.form.standardRuleInfos[i].sortNo = i+1
                            }
                        }

                        // 添加shopId字段
                        if(this.form.shopCode != undefined && this.form.shopCode.length > 0){
                            var shopId = ''
                            for(var item of this.form.shopCode){
                                for(var bItem of this.form.shopList){
                                    if(item == bItem.shopCode){
                                        shopId += bItem.id + ','
                                    }
                                }
                            }

                            if(this.form.shopCode.indexOf('b-other') != -1){
                                // 调整其他为最后一位
                                var index
                                for(var i=0;i<this.form.shopCode.length;i++){
                                    if(this.form.shopCode[i] == 'b-other'){
                                        index = i
                                    }
                                }
                                this.form.shopCode.splice(index, 1)
                                this.form.shopCode.push('b-other')

                                shopId += 'b-other'
                            }else{
                                var reg=/,$/gi
                                shopId = shopId.replace(reg,"");
                            }

                            this.form.shopId = shopId
                        }

                        // 处理订单类型
                        if(this.key == 'RK'){
                            if(Array.isArray(this.form.orderType)){
                                var orderType = this.form.orderType?this.form.orderType.join(','):''
                            }else{
                                var orderType = this.form.orderType
                            }
                            
                        }else{
                            var orderType = this.form.orderType?this.form.orderType.join(','):''
                        }

                        if(this.key == 'DBCK'){
                            var billingModel = this.form.billingModel

                            if(this.form.billingModel == 'piece' || this.form.billingModel == 'box'){
                                this.form.standardRuleInfos[0].weightRuleStatus = 1
                            }
                        }else{
                            var billingModel = ''
                        }
                        
                        if(this.addMode){ // 新增

                            let params = {
                                organizeId: this.organizeId,
                                whCode: this.code,
                                ruleType: this.key,
                                moduleType: this.moduleType,
                                projectName: this.form.projectName,
                                customerCode: this.form.customerCode,
                                ownerCode: this.form.ownerCode?this.form.ownerCode.join(','):'',
                                logisticsCompanyCode: this.form.logisticsCompanyCode?this.form.logisticsCompanyCode.join(','):'',
                                platformCode: this.form.platformCode?this.form.platformCode.join(','):'',
                                shopCode: this.form.shopCode?this.form.shopCode.join(','):'',
                                shopId: this.form.shopId,
                                // orderType: this.form.orderType?this.form.orderType.join(','):'',
                                orderType: orderType,
                                billingModel: billingModel,
                                ruleStatus: 0,
                                standardRuleStatus: this.form.standardRuleStatus,
                                standardRuleInfos: this.form.standardRuleInfos,
                                weightRuleInfos: this.form.weightRuleInfos,
                                specialRuleStatus: this.form.specialRuleStatus,
                                remark: this.form.remark,
                            }
                            
                            postNewSettlement(params).then((res)=>{
                                if(res.success){
                                    this.visible = false
                                    this.getGuaranteedValue()
                                }else{
                                    this.$message.warning(res.message)
                                }
                            })
                        }else{ // 修改

                            let params = {
                                id: this.id,
                                organizeId: this.organizeId,
                                whCode: this.code,
                                ruleType: this.key,
                                moduleType: this.moduleType,
                                projectName: this.form.projectName,
                                customerCode: this.form.customerCode,
                                ownerCode: this.form.ownerCode?this.form.ownerCode.join(','):'',
                                logisticsCompanyCode: this.form.logisticsCompanyCode?this.form.logisticsCompanyCode.join(','):'',
                                platformCode: this.form.platformCode?this.form.platformCode.join(','):'',
                                shopCode: this.form.shopCode?this.form.shopCode.join(','):'',
                                shopId: this.form.shopId,
                                // orderType: this.form.orderType?this.form.orderType.join(','):'',
                                orderType: orderType,
                                billingModel: billingModel,
                                ruleStatus: this.form.ruleStatus,
                                standardRuleStatus: this.form.standardRuleStatus,
                                standardRuleInfos: this.form.standardRuleInfos,
                                weightRuleInfos: this.form.weightRuleInfos,
                                specialRuleStatus: this.form.specialRuleStatus,
                                remark: this.form.remark,
                            }
                            
                            putModifySettlement(params).then((res)=>{
                                if(res.success){
                                    this.getGuaranteedValue()
                                    this.visible = false
                                }else{
                                    this.$message.warning(res.message)
                                }
                            })
                        }
                        
                    } else {
                        this.validStatus = false
                        return false;
                    }
                });
            },
            cancelForm() {
                this.visible = false;
            },
            // 删除
            deleteDrawer(record) {
                this.editVisible = true;
                this.ids = record.id
            },
            handleOk(e) {
                let params = {
                    ids: this.ids,
                }
                putDeleteSettlement(params).then((res)=>{
                    if(res.success){
                        this.editVisible = false;
                        this.selectedRowKeys = []
                        this.getGuaranteedValue()
                        this.$message.success('删除成功！')
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            },

            // 批量删除
            batchDelete() {
                if(this.selectedRowKeys.length <= 0){
                    this.$message.warning('请先勾选需要删除的项！')
                    return
                }
                this.batchDeleteVisible = true
                this.ids = this.selectedRowKeys.join(',')
            },
            batchDeleteHandleOk(e) {
                this.batchDeleteConfirmLoading = true;
                let params = {
                    ids: this.ids,
                }
                putDeleteSettlement(params).then((res)=>{
                    this.batchDeleteConfirmLoading = false
                    if(res.success){
                        this.batchDeleteVisible = false;
                        this.batchDeleteConfirmLoading = false;
                        this.selectNumber = 0
                        this.selectedRowKeys = []
                        this.deletdBtnShow = false
                        this.getGuaranteedValue()
                        this.$message.success('删除成功！')
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            },
            batchDeleteHandleCancel(e) {
                this.batchDeleteVisible = false;
            }, 
            // 启用
            doEnable() {
                if(this.selectedRowKeys.length <= 0){
                    this.$message.warning('请先勾选需要启用的项！')
                    return
                }

                for(var item of this.selectedRowKeys){
                    for(var bItem of this.data){
                        if(item == bItem.id){
                            if(bItem.ruleStatus == 0){
                                this.$message.warning('当前操作的数据存在已启用的数据！')
                                return
                            }
                        }
                    }
                }

                var flag = 0
                this.enableOrDisable(flag)
            },
            // 禁用
            doDisable() {
                if(this.selectedRowKeys.length <= 0){
                    this.$message.warning('请先勾选需要禁用的项！')
                    return
                }

                for(var item of this.selectedRowKeys){
                    for(var bItem of this.data){
                        if(item == bItem.id){
                            if(bItem.ruleStatus == 1){
                                this.$message.warning('当前操作的数据存在已禁用的数据！')
                                return
                            }
                        }
                    }
                }
                
                var flag = 1
                this.enableOrDisable(flag)
            },
            // 启用、禁用
            enableOrDisable(flag) {
                this.ids = this.selectedRowKeys.join(',')
                let params = {
                    ids: this.ids,
                    ruleStatus: flag,
                }
                putEnableDisableSettlement(params).then((res)=>{
                    if(res.success){
                        this.getGuaranteedValue()
                        if(flag == 0){
                            this.$message.success('启用成功！', 6)
                        }else{
                            this.$message.success('禁用成功！', 6)
                        }
                    }else{
                        this.$message.warning(res.message, 6)
                    }
                })
            },
            // 导出
            doExport() {
                if( (this.regionId == '' || this.regionId == undefined) || (this.cityId == '' || this.cityId == undefined) || (this.organizeId == '' || this.organizeId == undefined) ){
                    this.$message.warning('导出时必须先选择大区、城市和仓库！')
                    return
                }
                
                this.exportVisible = true
                this.id = this.selectedRowKeys.join(',')
            },
            exportHandleOk(e) {
                this.exportConfirmLoading = true;

                let params = {
                    id: this.id,
                    organizeId: this.organizeId,
                    whCode: this.code,
                    ruleType: this.ruleType,
                    projectName: this.projectName,
                    createBy: this.createBy,
                    updateBy: this.updateBy,
                    createTime_begin: this.createTime_begin,
                    createTime_end: this.createTime_end,
                    updateTime_begin: this.updateTime_begin,
                    updateTime_end: this.updateTime_end,
                    delFlag: 0,
                }

                getSettlementRuleExport(params).then((data)=>{
                    if (!data) {
                        this.$message.warning("文件下载失败")
                        return
                    }
                    if (typeof window.navigator.msSaveBlob !== 'undefined') {
                        window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), '结算规则'+'.xls')
                    }else{
                        let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'}))
                        let link = document.createElement('a')
                        link.style.display = 'none'
                        link.href = url
                        link.setAttribute('download', '结算规则'+'.xls')
                        document.body.appendChild(link)
                        link.click()
                        document.body.removeChild(link); //下载完成移除元素
                        window.URL.revokeObjectURL(url); //释放掉blob对象
                        this.selectNumber = 0
                        this.selectedRowKeys = []
                        this.deletdBtnShow = false
                        this.exportVisible = false;
                        this.exportConfirmLoading = false;
                    }
                })

            },
            exportHandleCancel(e) {
                this.exportVisible = false;
            },

            // 获取客户名称列表
            getCustomerName() {
                let params = {
                    whCode: this.code,
                }
                getCustomerName(params).then((res)=>{
                    if(res.success){
                        this.customerList = res.result
                        this.form.customerList = res.result
                        this.ckForm.customerList = res.result
                    }else{
                        this.$message.warning(res.message, 6)
                    }
                })
            },
            // 选择商家
            customerChange() {
                this.form.ownerCode = []
                this.ckForm.ownerCode = []
                this.getOwnerName()
                this.form.logisticsCompanyCode = []
                this.ckForm.logisticsCompanyCode = []
                this.getLogisticsName()
                this.form.platformCode = []
                this.ckForm.platformCode = []
                this.getplatformName()
                this.form.shopCode = []
                this.ckForm.shopCode = []
                this.form.shopList = []
                this.ckForm.shopList = []
            },            
            // 获取货主名称列表
            getOwnerName() {
                let params
                if(this.key == 'CK'){
                    params = {
                        whCode: this.code,
                        customerCode: this.ckForm.customerCode,
                    } 
                }else{
                    params = {
                        whCode: this.code,
                        customerCode: this.form.customerCode,
                    }
                }

                getOwnerName(params).then((res)=>{
                    if(res.success){
                        this.form.ownerList = res.result
                        this.ckForm.ownerList = res.result
                    }else{
                        this.$message.warning(res.message, 6)
                    }
                })
            },
            // 获取物流公司名称列表
            getLogisticsName() {
                let params
                if(this.key == 'CK'){
                    params = {
                        whCode: this.code,
                        customerCode: this.ckForm.customerCode,
                    } 
                }else{
                    params = {
                        whCode: this.code,
                        customerCode: this.form.customerCode,
                    }
                }

                getLogisticsName(params).then((res)=>{
                    if(res.success){
                        this.form.logisticsCompanyList = res.result
                        this.ckForm.logisticsCompanyList = res.result
                    }else{
                        this.$message.warning(res.message, 6)
                    }
                })
            },
            // 获取平台名称列表
            getplatformName() {
                let params
                if(this.key == 'CK'){
                    params = {
                        whCode: this.code,
                        customerCode: this.ckForm.customerCode,
                    } 
                }else{
                    params = {
                        whCode: this.code,
                        customerCode: this.form.customerCode,
                    }
                }

                getplatformName(params).then((res)=>{
                    if(res.success){
                        this.form.platformList = res.result
                        this.ckForm.platformList = res.result
                    }else{
                        this.$message.warning(res.message, 6)
                    }
                })
            },
            // 选择平台
            platformChange(value) {
                this.form.platformCode = value
                this.ckForm.platformCode = value
                this.form.shopCode = []
                this.ckForm.shopCode = []
                this.form.shopList = []
                this.ckForm.shopList = []

                // 判断是否有选择平台，有就请求店铺
                if(value.length == 0){
                    return
                }
                this.getShopName()
            },
            // 获取店铺名称列表
            getShopName() {
                let params
                if(this.key == 'CK'){
                    params = {
                        whCode: this.code,
                        customerCode: this.ckForm.customerCode,
                        platformCode: this.ckForm.platformCode.join(',')
                    } 
                }else{
                    params = {
                        whCode: this.code,
                        customerCode: this.form.customerCode,
                        platformCode: this.form.platformCode.join(',')
                    }
                }

                getShopName(params).then((res)=>{
                    if(res.success){
                        // 根据chopCode去重店铺
                        var arr = res.result
                        var result = [];
                        var obj = {};
                        for(var i =0; i<arr.length; i++){
                            if(!obj[arr[i].shopCode]){
                                result.push(arr[i]);
                                obj[arr[i].shopCode] = true;
                            }
                        }

                        this.form.shopList = result
                        this.ckForm.shopList = result
                    }else{
                        this.$message.warning(res.message, 6)
                    }
                })
            },

            // 出库逻辑
            // 出库抽屉关闭
            ckOnClose() {
                this.ckVisible = false
            },
            // 出库单位选择
            ckUnitChange(value) {
                this.ckForm.quantityUnit = value

                for(var item of this.ckForm.standardRuleInfos){
                    item.quantityUnit = value
                }
                for(var item of this.ckForm.standardWeightRuleInfos){
                    item.quantityUnit = value
                }
                for(var item of this.ckForm.coldRuleInfos){
                    item.quantityUnit = value
                }
                for(var item of this.ckForm.coldWeightRuleInfos){
                    item.quantityUnit = value
                }
                for(var item of this.ckForm.drinksRuleInfos){
                    item.quantityUnit = value
                }
                for(var item of this.ckForm.drinksWeightRuleInfos){
                    item.quantityUnit = value
                }
            },
            // 出库确定
            ckOnSubmit() {

                this.$refs.ckRuleForm.validate(valid => {
                    
                    if (valid) {
                        this.ckValidStatus = true

                        // 出库规则验证
                        // 标准规则验证
                        if(this.ckForm.isCkStandardShow){
                            for(var item of this.ckForm.standardRuleInfos){
                                if(( (item.quantityBeginValue == '' && item.quantityBeginValue != 0) || item.quantityBeginValue == null)  || ( (item.quantityEndValue == '' && item.quantityEndValue != 0) || item.quantityEndValue == null) || ( (item.skuBeginValue == '' && item.skuBeginValue != 0) || item.skuBeginValue == null) || ( (item.skuEndValue == '' && item.skuEndValue != 0) || item.skuEndValue == null) || ( (item.weightBeginValue == '' && item.weightBeginValue != 0) || item.weightBeginValue == null) || ( (item.weightEndValue == '' && item.weightEndValue != 0) || item.weightEndValue == null) || (item.rulePrice == '' || item.rulePrice == null) ){
                                    this.$message.warning('请填写标准规则配置：数量区间、SKU类数、重量区间和规则价格！')
                                    return
                                }
                                if(item.quantityBeginValue >= item.quantityEndValue || item.skuBeginValue >= item.skuEndValue || item.weightBeginValue >= item.weightEndValue){
                                    this.$message.warning('请填写正确的标准规则配置：数量区间或SKU类数或重量区间！')
                                    return
                                }
                            }

                            if(this.ckForm.standardRuleInfos.length >= 2){
                                var sList = this.ckForm.standardRuleInfos
                                for(var i=0;i<sList.length-1;i++){
                                    // 验证规则
                                    if(sList[i].quantityEndValue >= sList[i+1].quantityBeginValue && sList[i].skuEndValue >= sList[i+1].skuBeginValue && sList[i].weightEndValue >= sList[i+1].weightBeginValue){
                                        this.$message.warning('标准规则配置：数量区间、SKU类数、重量区间存在冲突！')
                                        return
                                    }
                                    if(sList[i+1].quantityEndValue < sList[i].quantityEndValue || sList[i+1].skuEndValue < sList[i].skuEndValue || sList[i+1].weightEndValue < sList[i].weightEndValue){
                                        this.$message.warning('标准规则配置：后面一条规则的数量、SKU、重量起止区间数据中的止数据必须大于或等于前面任意规则的止数据！')
                                        return
                                    }
                                }
                            }

                            if(this.ckForm.isCkStandardWeightShow){
                                var sList = this.ckForm.standardWeightRuleInfos

                                if(sList[0].quantity == '' && sList[0].quantityPrice == '' && sList[0].sku == '' && sList[0].skuPrice == '' && sList[0].weight == '' && sList[0].weightPrice == ''){
                                    this.$message.warning('请填写标准规则配置：续重规则配置！')
                                    return
                                }

                                var num = 3;
                                var flag = false;
                                if(((sList[0].quantity >= 0 && sList[0].quantity != null && sList[0].quantity != '') && (sList[0].quantityPrice >= 0 && sList[0].quantityPrice != null && sList[0].quantityPrice != ''))){
                                    num--;
                                }

                                if(((sList[0].sku >= 0 && sList[0].sku != null && sList[0].sku != '') && (sList[0].skuPrice >= 0 && sList[0].skuPrice != null && sList[0].skuPrice != ''))){
                                    num--;
                                }
                                
                                if(((sList[0].weight >= 0 && sList[0].weight != null && sList[0].weight != '') && (sList[0].weightPrice >= 0 && sList[0].weightPrice != null && sList[0].weightPrice != ''))){
                                    num--;
                                }

                                if( ( ((sList[0].quantity >= 0 && sList[0].quantity != null && sList[0].quantity != '') && (sList[0].quantityPrice == null || sList[0].quantityPrice == '')) ) || ( ((sList[0].quantity == null || sList[0].quantity == '') && (sList[0].quantityPrice >= 0 && sList[0].quantityPrice != null && sList[0].quantityPrice != '')) ) ){
                                    flag = true;
                                }

                                if( ( ((sList[0].sku >= 0 && sList[0].sku != null && sList[0].sku != '') && (sList[0].skuPrice == null || sList[0].skuPrice == '')) ) || ( ((sList[0].sku == null || sList[0].sku == '') && (sList[0].skuPrice >= 0 && sList[0].skuPrice != null && sList[0].skuPrice != '')) ) ){
                                    flag = true;
                                }

                                if( ( ((sList[0].weight >= 0 && sList[0].weight != null && sList[0].weight != '') && (sList[0].weightPrice == null || sList[0].weightPrice == '')) ) || ( ((sList[0].weight == null || sList[0].weight == '') && (sList[0].weightPrice >= 0 && sList[0].weightPrice != null && sList[0].weightPrice != '')) ) ){
                                    flag = true;
                                }

                                if(num==3 || flag){
                                    this.$message.warning('请填写标准规则配置：续重规则配置！')
                                    return
                                }

                            }
                        }

                        // 特殊规则验证
                        if(this.ckForm.isCkSpecialShow){
                            // 冷库
                            if(this.ckForm.isCkColdShow){
                                for(var item of this.ckForm.coldRuleInfos){
                                    if(( (item.quantityBeginValue == '' && item.quantityBeginValue != 0) || item.quantityBeginValue == null)  || ( (item.quantityEndValue == '' && item.quantityEndValue != 0) || item.quantityEndValue == null) || ( (item.skuBeginValue == '' && item.skuBeginValue != 0) || item.skuBeginValue == null) || ( (item.skuEndValue == '' && item.skuEndValue != 0) || item.skuEndValue == null) || ( (item.weightBeginValue == '' && item.weightBeginValue != 0) || item.weightBeginValue == null) || ( (item.weightEndValue == '' && item.weightEndValue != 0) || item.weightEndValue == null) || (item.rulePrice == '' || item.rulePrice == null) ){
                                        this.$message.warning('请填写特殊规则配置冷库：数量区间、SKU类数、重量区间和规则价格！')
                                        return
                                    }
                                    if(item.quantityBeginValue >= item.quantityEndValue || item.skuBeginValue >= item.skuEndValue || item.weightBeginValue >= item.weightEndValue){
                                        this.$message.warning('请填写正确的特殊规则配置冷库：数量区间或SKU类数或重量区间！')
                                        return
                                    }
                                }

                                if(this.ckForm.coldRuleInfos.length >= 2){
                                    var sList = this.ckForm.coldRuleInfos
                                    for(var i=0;i<sList.length-1;i++){
                                        // 验证规则
                                        if(sList[i].quantityEndValue >= sList[i+1].quantityBeginValue && sList[i].skuEndValue >= sList[i+1].skuBeginValue && sList[i].weightEndValue >= sList[i+1].weightBeginValue){
                                            this.$message.warning('特殊规则配置冷库：数量区间、SKU类数、重量区间存在冲突！')
                                            return
                                        }
                                        if(sList[i+1].quantityEndValue < sList[i].quantityEndValue || sList[i+1].skuEndValue < sList[i].skuEndValue || sList[i+1].weightEndValue < sList[i].weightEndValue){
                                            this.$message.warning('特殊规则配置冷库：后面一条规则的数量、SKU、重量起止区间数据中的止数据必须大于或等于前面任意规则的止数据！')
                                            return
                                        }
                                    }
                                }
                                
                                if(this.ckForm.isCkColdWeightShow){
                                    var sList = this.ckForm.coldWeightRuleInfos

                                    if((sList[0].quantity == '' || sList[0].quantity == null) && (sList[0].quantityPrice == '' || sList[0].quantityPrice == null) && (sList[0].sku == '' || sList[0].sku == null) && (sList[0].skuPrice == '' || sList[0].skuPrice == null) && (sList[0].weight == '' || sList[0].weight == null) && (sList[0].weightPrice == '' || sList[0].weightPrice == null)){
                                        this.$message.warning('请填写特殊规则配置冷库：续重规则配置！')
                                        return
                                    }

                                    var num = 3;
                                    var flag = false;
                                    if(((sList[0].quantity >= 0 && sList[0].quantity != null && sList[0].quantity != '') && (sList[0].quantityPrice >= 0 && sList[0].quantityPrice != null && sList[0].quantityPrice != ''))){
                                        num--;
                                    }

                                    if(((sList[0].sku >= 0 && sList[0].sku != null && sList[0].sku != '') && (sList[0].skuPrice >= 0 && sList[0].skuPrice != null && sList[0].skuPrice != ''))){
                                        num--;
                                    }
                                    
                                    if(((sList[0].weight >= 0 && sList[0].weight != null && sList[0].weight != '') && (sList[0].weightPrice >= 0 && sList[0].weightPrice != null && sList[0].weightPrice != ''))){
                                        num--;
                                    }

                                    if( ( ((sList[0].quantity >= 0 && sList[0].quantity != null && sList[0].quantity != '') && (sList[0].quantityPrice == null || sList[0].quantityPrice == '')) ) || ( ((sList[0].quantity == null || sList[0].quantity == '') && (sList[0].quantityPrice >= 0 && sList[0].quantityPrice != null && sList[0].quantityPrice != '')) ) ){
                                        flag = true;
                                    }

                                    if( ( ((sList[0].sku >= 0 && sList[0].sku != null && sList[0].sku != '') && (sList[0].skuPrice == null || sList[0].skuPrice == '')) ) || ( ((sList[0].sku == null || sList[0].sku == '') && (sList[0].skuPrice >= 0 && sList[0].skuPrice != null && sList[0].skuPrice != '')) ) ){
                                        flag = true;
                                    }

                                    if( ( ((sList[0].weight >= 0 && sList[0].weight != null && sList[0].weight != '') && (sList[0].weightPrice == null || sList[0].weightPrice == '')) ) || ( ((sList[0].weight == null || sList[0].weight == '') && (sList[0].weightPrice >= 0 && sList[0].weightPrice != null && sList[0].weightPrice != '')) ) ){
                                        flag = true;
                                    }

                                    if(num==3 || flag){
                                        this.$message.warning('请填写特殊规则配置冷库：续重规则配置！')
                                        return
                                    }

                                }
                            }

                            // 酒水
                            if(this.ckForm.isCkDrinksShow){
                                for(var item of this.ckForm.drinksRuleInfos){
                                    if(( (item.quantityBeginValue == '' && item.quantityBeginValue != 0) || item.quantityBeginValue == null)  || ( (item.quantityEndValue == '' && item.quantityEndValue != 0) || item.quantityEndValue == null) || ( (item.skuBeginValue == '' && item.skuBeginValue != 0) || item.skuBeginValue == null) || ( (item.skuEndValue == '' && item.skuEndValue != 0) || item.skuEndValue == null) || ( (item.weightBeginValue == '' && item.weightBeginValue != 0) || item.weightBeginValue == null) || ( (item.weightEndValue == '' && item.weightEndValue != 0) || item.weightEndValue == null) || (item.rulePrice == '' || item.rulePrice == null) ){
                                        this.$message.warning('请填写特殊规则配置酒水：数量区间、SKU类数、重量区间和规则价格！')
                                        return
                                    }
                                    if(item.quantityBeginValue >= item.quantityEndValue || item.skuBeginValue >= item.skuEndValue || item.weightBeginValue >= item.weightEndValue){
                                        this.$message.warning('请填写正确的特殊规则配置酒水：数量区间或SKU类数或重量区间！')
                                        return
                                    }
                                }

                                if(this.ckForm.drinksRuleInfos.length >= 2){
                                    var sList = this.ckForm.drinksRuleInfos
                                    for(var i=0;i<sList.length-1;i++){
                                        // 验证规则
                                        if(sList[i].quantityEndValue >= sList[i+1].quantityBeginValue && sList[i].skuEndValue >= sList[i+1].skuBeginValue && sList[i].weightEndValue >= sList[i+1].weightBeginValue){
                                            this.$message.warning('特殊规则配置酒水：数量区间、SKU类数、重量区间存在冲突！')
                                            return
                                        }
                                        if(sList[i+1].quantityEndValue < sList[i].quantityEndValue || sList[i+1].skuEndValue < sList[i].skuEndValue || sList[i+1].weightEndValue < sList[i].weightEndValue){
                                            this.$message.warning('特殊规则配置酒水：后面一条规则的数量、SKU、重量起止区间数据中的止数据必须大于或等于前面任意规则的止数据！')
                                            return
                                        }
                                    }
                                }

                                if(this.ckForm.isCkDrinksWeightShow){
                                    var sList = this.ckForm.drinksWeightRuleInfos
                                    if((sList[0].quantity == '' || sList[0].quantity == null) && (sList[0].quantityPrice == '' || sList[0].quantityPrice == null) && (sList[0].sku == '' || sList[0].sku == null) && (sList[0].skuPrice == '' || sList[0].skuPrice == null) && (sList[0].weight == '' || sList[0].weight == null) && (sList[0].weightPrice == '' || sList[0].weightPrice == null)){
                                        this.$message.warning('请填写特殊规则配置酒水：续重规则配置！')
                                        return
                                    }

                                    var num = 3;
                                    var flag = false;
                                    if(((sList[0].quantity >= 0 && sList[0].quantity != null && sList[0].quantity != '') && (sList[0].quantityPrice >= 0 && sList[0].quantityPrice != null && sList[0].quantityPrice != ''))){
                                        num--;
                                    }

                                    if(((sList[0].sku >= 0 && sList[0].sku != null && sList[0].sku != '') && (sList[0].skuPrice >= 0 && sList[0].skuPrice != null && sList[0].skuPrice != ''))){
                                        num--;
                                    }
                                    
                                    if(((sList[0].weight >= 0 && sList[0].weight != null && sList[0].weight != '') && (sList[0].weightPrice >= 0 && sList[0].weightPrice != null && sList[0].weightPrice != ''))){
                                        num--;
                                    }

                                    if( ( ((sList[0].quantity >= 0 && sList[0].quantity != null && sList[0].quantity != '') && (sList[0].quantityPrice == null || sList[0].quantityPrice == '')) ) || ( ((sList[0].quantity == null || sList[0].quantity == '') && (sList[0].quantityPrice >= 0 && sList[0].quantityPrice != null && sList[0].quantityPrice != '')) ) ){
                                        flag = true;
                                    }

                                    if( ( ((sList[0].sku >= 0 && sList[0].sku != null && sList[0].sku != '') && (sList[0].skuPrice == null || sList[0].skuPrice == '')) ) || ( ((sList[0].sku == null || sList[0].sku == '') && (sList[0].skuPrice >= 0 && sList[0].skuPrice != null && sList[0].skuPrice != '')) ) ){
                                        flag = true;
                                    }

                                    if( ( ((sList[0].weight >= 0 && sList[0].weight != null && sList[0].weight != '') && (sList[0].weightPrice == null || sList[0].weightPrice == '')) ) || ( ((sList[0].weight == null || sList[0].weight == '') && (sList[0].weightPrice >= 0 && sList[0].weightPrice != null && sList[0].weightPrice != '')) ) ){
                                        flag = true;
                                    }

                                    if(num==3 || flag){
                                        this.$message.warning('请填写特殊规则配置酒水：续重规则配置！')
                                        return
                                    }

                                }
                            }
                        }

                        // 判断是否有标准规则
                        if(!this.ckForm.standardSwitchValue){
                            this.ckForm.standardRuleInfos = []
                            this.ckForm.standardWeightRuleInfos = []
                        }
                        
                        // 判断是否有标准续重
                        if(this.ckForm.isCkStandardWeightShow){
                            if(this.ckForm.standardWeightRuleInfos.length > 0){
                                for(var item of this.ckForm.standardRuleInfos){
                                    item.weightRuleStatus = 0
                                }
                            }
                        }else{
                            this.ckForm.standardWeightRuleInfos = []
                            if(this.ckForm.standardRuleInfos.length > 0){
                                for(var item of this.ckForm.standardRuleInfos){
                                    item.weightRuleStatus = 1
                                }
                            }
                        }
                        
                        // 判断是否有特殊规则
                        if(!this.ckForm.specialSwitchValue){
                            this.ckForm.specialRuleStatus = 1
                            this.ckForm.coldRuleInfos = []
                            this.ckForm.coldWeightRuleInfos = []
                            this.ckForm.drinksRuleInfos = []
                            this.ckForm.drinksWeightRuleInfos = []
                        }
                        
                        // 判断是否冷库
                        if(!this.ckForm.isCkColdShow){
                            this.ckForm.coldRuleInfos = []
                            this.ckForm.coldWeightRuleInfos = []
                        }
                        
                        // 判断是否冷库续重
                        if(this.ckForm.isCkColdWeightShow){
                            if(this.ckForm.coldWeightRuleInfos.length > 0){
                                for(var item of this.ckForm.coldRuleInfos){
                                    item.weightRuleStatus = 0
                                }
                            }
                        }else{
                            this.ckForm.coldWeightRuleInfos = []
                            if(this.ckForm.coldRuleInfos.length > 0){
                                for(var item of this.ckForm.coldRuleInfos){
                                    item.weightRuleStatus = 1
                                }
                            }
                        }
                        
                        // 判断是否酒水
                        if(!this.ckForm.isCkDrinksShow){
                            this.ckForm.drinksRuleInfos = []
                            this.ckForm.drinksWeightRuleInfos = []
                        }
                        
                        // 判断是否酒水续重
                        if(this.ckForm.isCkDrinksWeightShow){
                            if(this.ckForm.drinksWeightRuleInfos.length > 0){
                                for(var item of this.ckForm.drinksRuleInfos){
                                    item.weightRuleStatus = 0
                                }
                            }
                        }else{
                            this.ckForm.drinksWeightRuleInfos = []
                            if(this.ckForm.drinksRuleInfos.length > 0){
                                for(var item of this.ckForm.drinksRuleInfos){
                                    item.weightRuleStatus = 1
                                }
                            }
                        }

                        // 添加sortNo字段
                        // 标准
                        if(this.ckForm.standardRuleInfos.length > 0){
                            for(var i=0;i<this.ckForm.standardRuleInfos.length;i++){
                                this.ckForm.standardRuleInfos[i].sortNo = i+1
                            }
                        }
                        // 冷库
                        if(this.ckForm.coldRuleInfos.length > 0){
                            for(var i=0;i<this.ckForm.coldRuleInfos.length;i++){
                                this.ckForm.coldRuleInfos[i].sortNo = i+1
                            }
                        }
                        // 酒水
                        if(this.ckForm.drinksRuleInfos.length > 0){
                            for(var i=0;i<this.ckForm.drinksRuleInfos.length;i++){
                                this.ckForm.drinksRuleInfos[i].sortNo = i+1
                            }
                        }

                        // 添加shopId字段
                        if(this.ckForm.shopCode.length > 0){
                            var shopId = ''
                            for(var item of this.ckForm.shopCode){
                                for(var bItem of this.ckForm.shopList){
                                    if(item == bItem.shopCode){
                                        shopId += bItem.id + ','
                                    }
                                }
                            }

                            if(this.ckForm.shopCode.indexOf('b-other') != -1){
                                // 调整其他为最后一位
                                var index
                                for(var i=0;i<this.ckForm.shopCode.length;i++){
                                    if(this.ckForm.shopCode[i] == 'b-other'){
                                        index = i
                                    }
                                }
                                this.ckForm.shopCode.splice(index, 1)
                                this.ckForm.shopCode.push('b-other')

                                shopId += 'b-other'
                            }else{
                                var reg=/,$/gi
                                shopId = shopId.replace(reg,"");
                            }

                            this.ckForm.shopId = shopId
                        }

                        var specialRuleInfos = this.ckForm.coldRuleInfos.concat(this.ckForm.drinksRuleInfos)
                        var weightRuleInfos = this.ckForm.standardWeightRuleInfos.concat(this.ckForm.coldWeightRuleInfos).concat(this.ckForm.drinksWeightRuleInfos)
                        
                        if(this.addMode){ // 新增

                            let params = {
                                organizeId: this.organizeId,
                                whCode: this.code,
                                ruleType: this.key,
                                moduleType: 'output',
                                projectName: this.ckForm.projectName,
                                customerCode: this.ckForm.customerCode,
                                ownerCode: this.ckForm.ownerCode?this.ckForm.ownerCode.join(','):'',
                                logisticsCompanyCode: this.ckForm.logisticsCompanyCode?this.ckForm.logisticsCompanyCode.join(','):'',
                                platformCode: this.ckForm.platformCode?this.ckForm.platformCode.join(','):'',
                                shopCode: this.ckForm.shopCode?this.ckForm.shopCode.join(','):'',
                                shopId: this.ckForm.shopId,
                                orderType: this.ckForm.orderType?this.ckForm.orderType.join(','):'',
                                remark: this.ckForm.remark,
                                ruleStatus: 0,
                                standardRuleStatus: this.ckForm.standardRuleStatus,
                                standardRuleInfos: this.ckForm.standardRuleInfos,
                                specialRuleStatus: this.ckForm.specialRuleStatus,
                                specialRuleInfos: specialRuleInfos,
                                weightRuleInfos: weightRuleInfos,
                            }
                            postNewSettlement(params).then((res)=>{
                                if(res.success){
                                    this.ckVisible = false
                                    this.getGuaranteedValue()
                                }else{
                                    this.$message.warning(res.message)
                                }
                            })
                        }else{ // 修改

                            let params = {
                                id: this.id,
                                organizeId: this.organizeId,
                                whCode: this.code,
                                ruleType: this.key,
                                moduleType: 'output',
                                projectName: this.ckForm.projectName,
                                customerCode: this.ckForm.customerCode,
                                ownerCode: this.ckForm.ownerCode?this.ckForm.ownerCode.join(','):'',
                                logisticsCompanyCode: this.ckForm.logisticsCompanyCode?this.ckForm.logisticsCompanyCode.join(','):'',
                                platformCode: this.ckForm.platformCode?this.ckForm.platformCode.join(','):'',
                                shopCode: this.ckForm.shopCode?this.ckForm.shopCode.join(','):'',
                                shopId: this.ckForm.shopId,
                                orderType: this.ckForm.orderType?this.ckForm.orderType.join(','):'',
                                remark: this.ckForm.remark,
                                ruleStatus: this.ckForm.ruleStatus,
                                standardRuleStatus: this.ckForm.standardRuleStatus,
                                standardRuleInfos: this.ckForm.standardRuleInfos,
                                specialRuleStatus: this.ckForm.specialRuleStatus,
                                specialRuleInfos: specialRuleInfos,
                                weightRuleInfos: weightRuleInfos,
                            }
                            putModifySettlement(params).then((res)=>{
                                if(res.success){
                                    this.ckVisible = false
                                    this.getGuaranteedValue()
                                }else{
                                    this.$message.warning(res.message)
                                }
                            })
                        }
                        
                    } else {
                        this.ckValidStatus = false
                        return false;
                    }
                })
            },
            // 出库取消
            ckCancelForm() {
                this.ckVisible = false
            },
            // 出库标准规则配置开关
            standardSwitchChange(checked) {
                if(this.ckForm.specialSwitchValue){
                    this.ckForm.isCkStandardShow = checked
                    if(checked){
                        this.ckForm.standardRuleStatus = 0
                        this.ckForm.standardRuleInfos = [
                            {
                                quantityBeginValue: '',
                                quantityEndValue: '',
                                skuBeginValue: '',
                                skuEndValue: '',
                                weightBeginValue: '',
                                weightEndValue: '',
                                quantityUnit: this.ckForm.quantityUnit,
                                rulePrice: '',
                                isCutShow: false,
                                isPlusShow: true,
                                weightRuleStatus: 0,
                            }
                        ]

                        this.ckForm.standardWeightRuleInfos = [
                            {
                                weightRuleType: 'standard',
                                quantity: '',
                                quantityUnit: this.ckForm.quantityUnit,
                                quantityPrice: '',
                                sku: '',
                                skuPrice: '',
                                weight: '',
                                weightPrice: '',
                            },
                        ]
                        this.ckForm.standardWeightRuleStatus = 0
                        this.ckForm.isCkStandardWeightShow = true
                    }else{
                        this.ckForm.standardRuleStatus = 1
                        // this.ckForm.standardRuleInfos = []
                        // this.ckForm.standardWeightRuleInfos = []
                    }
                }else{
                    this.ckForm.standardSwitchValue = true
                    this.$message.warning('标准规则配置和特殊规则配置不能同时关闭！', 6)
                }
            },
            
            // 出库标准规则删除
            ckStandardCutRule(index) {
                this.ckForm.standardRuleInfos.splice(index, 1)
                this.ckStandardSetCutPlus()
            },
            // 出库标准规则添加
            ckStandardPlusRule() {
                this.ckForm.standardRuleInfos.push(
                    {
                        quantityBeginValue: '',
                        quantityEndValue: '',
                        skuBeginValue: '',
                        skuEndValue: '',
                        weightBeginValue: '',
                        weightEndValue: '',
                        quantityUnit: this.ckForm.quantityUnit,
                        rulePrice: '',
                        isCutShow: true,
                        isPlusShow: true,
                        weightRuleStatus: 0,
                    },
                )
                this.ckStandardSetCutPlus()
            },
            // 设置删除和添加按钮显示隐藏
            ckStandardSetCutPlus() {
                var list = this.ckForm.standardRuleInfos
                if(list.length == 1){
                    list[0].isCutShow = false
                    list[0].isPlusShow = true
                }else if(list.length > 1){
                    for(var item of list){
                        item.isCutShow = true
                        item.isPlusShow = false
                    }
                    list[list.length-1].isPlusShow = true
                }

                // 查看时隐藏删除添加按钮
                if(this.btnDisabled){
                    for(var item of list){
                        item.isCutShow = false
                        item.isPlusShow = false
                    }
                }

                this.ckForm.standardRuleInfos = list
                this.$forceUpdate()
            },
            // 出库标准续重规则配置开关
            ckStandardWeightChange(e) {
                if(e.target.value == 0){
                    this.ckForm.isCkStandardWeightShow = true

                    this.ckForm.standardWeightRuleInfos = [
                        {
                            weightRuleType: 'standard',
                            quantity: '',
                            quantityUnit: this.ckForm.quantityUnit,
                            quantityPrice: '',
                            sku: '',
                            skuPrice: '',
                            weight: '',
                            weightPrice: '',
                        },
                    ]
                }else{
                    this.ckForm.isCkStandardWeightShow = false

                    // this.ckForm.standardWeightRuleInfos = []
                }
            },
            // 出库特殊规则配置开关
            specialSwitchChange(checked) {
                if(this.ckForm.standardSwitchValue){
                    this.ckForm.isCkSpecialShow = checked
                    if(checked){
                        this.ckForm.specialRuleStatus = 0

                        this.ckForm.coldRuleInfos = [
                            {
                                specialRuleType: 'cold',
                                quantityBeginValue: '',
                                quantityEndValue: '',
                                skuBeginValue: '',
                                skuEndValue: '',
                                weightBeginValue: '',
                                weightEndValue: '',
                                quantityUnit: this.ckForm.quantityUnit,
                                rulePrice: '',
                                isCutShow: false,
                                isPlusShow: true,
                                weightRuleStatus: 0,
                            }
                        ]
                        this.ckForm.coldWeightRuleInfos = [
                            {
                                weightRuleType: 'cold',
                                quantity: '',
                                quantityUnit: this.ckForm.quantityUnit,
                                quantityPrice: '',
                                sku: '',
                                skuPrice: '',
                                weight: '',
                                weightPrice: '',
                            },
                        ]
                        this.ckForm.drinksRuleInfos = [
                            {
                                specialRuleType: 'drinks',
                                quantityBeginValue: '',
                                quantityEndValue: '',
                                skuBeginValue: '',
                                skuEndValue: '',
                                weightBeginValue: '',
                                weightEndValue: '',
                                quantityUnit: this.ckForm.quantityUnit,
                                rulePrice: '',
                                isCutShow: false,
                                isPlusShow: true,
                                weightRuleStatus: 0,
                            }
                        ]
                        this.ckForm.drinksWeightRuleInfos = [
                            {
                                weightRuleType: 'drinks',
                                quantity: '',
                                quantityUnit: this.ckForm.quantityUnit,
                                quantityPrice: '',
                                sku: '',
                                skuPrice: '',
                                weight: '',
                                weightPrice: '',
                            },
                        ]
                        this.ckForm.coldRuleStatus = 0
                        this.ckForm.isCkColdShow = true
                        this.ckForm.coldWeightStatus = 0
                        this.ckForm.isCkColdWeightShow = true
                        this.ckForm.drinksRuleStatus = 0
                        this.ckForm.isCkDrinksShow = true
                        this.ckForm.drinksWeightStatus = 0
                        this.ckForm.isCkDrinksWeightShow = true

                    }else{
                        this.ckForm.specialRuleStatus = 1

                        // this.ckForm.coldRuleInfos = []
                        // this.ckForm.drinksRuleInfos = []
                        // this.ckForm.coldWeightRuleInfos = []
                        // this.ckForm.drinksWeightRuleInfos = []
                    }

                }else{
                    this.ckForm.specialSwitchValue = true
                    this.$message.warning('标准规则配置和特殊规则配置不能同时关闭！', 6)
                }
            },
            // 出库冷库删除规则
            ckColdStandardCutRule(index) {
                this.ckForm.coldRuleInfos.splice(index, 1)
                this.ckColdSetCutPlus()
            },
            ckColdStandardPlusRule() {
                this.ckForm.coldRuleInfos.push(
                    {
                        specialRuleType: 'cold',
                        quantityBeginValue: '',
                        quantityEndValue: '',
                        skuBeginValue: '',
                        skuEndValue: '',
                        weightBeginValue: '',
                        weightEndValue: '',
                        quantityUnit: this.ckForm.quantityUnit,
                        rulePrice: '',
                        isCutShow: true,
                        isPlusShow: true,
                        weightRuleStatus: 0,
                    },
                )
                this.ckColdSetCutPlus()
            },
            // 设置出库冷库删除和添加按钮显示隐藏
            ckColdSetCutPlus() {
                var list = this.ckForm.coldRuleInfos
                if(list.length == 1){
                    list[0].isCutShow = false
                    list[0].isPlusShow = true
                }else if(list.length > 1){
                    for(var item of list){
                        item.isCutShow = true
                        item.isPlusShow = false
                    }
                    list[list.length-1].isPlusShow = true
                }

                // 查看时隐藏删除添加按钮
                if(this.btnDisabled){
                    for(var item of list){
                        item.isCutShow = false
                        item.isPlusShow = false
                    }
                }

                this.ckForm.coldRuleInfos = list
                this.$forceUpdate()
            },
            // 出库冷库选择
            ckColdChange(e) {
                if(e.target.value == 0){
                    this.ckForm.coldRuleStatus = 0
                    this.ckForm.isCkColdShow = true
                    this.ckForm.coldWeightStatus = 0
                    this.ckForm.isCkColdWeightShow = true

                    this.ckForm.coldRuleInfos = [
                        {
                            specialRuleType: 'cold',
                            quantityBeginValue: '',
                            quantityEndValue: '',
                            skuBeginValue: '',
                            skuEndValue: '',
                            weightBeginValue: '',
                            weightEndValue: '',
                            quantityUnit: this.ckForm.quantityUnit,
                            rulePrice: '',
                            isCutShow: false,
                            isPlusShow: true,
                            weightRuleStatus: 0,
                        }
                    ]
                    this.ckForm.coldWeightRuleInfos = [
                        {
                            weightRuleType: 'cold',
                            quantity: '',
                            quantityUnit: this.ckForm.quantityUnit,
                            quantityPrice: '',
                            sku: '',
                            skuPrice: '',
                            weight: '',
                            weightPrice: '',
                        },
                    ]
                }else{
                    this.ckForm.coldRuleStatus = 1
                    this.ckForm.isCkColdShow = false
                    this.ckForm.coldWeightStatus = 1
                    this.ckForm.isCkColdWeightShow = false

                    // 判断是否关闭整个特殊规则配置
                    if(this.ckForm.drinksRuleStatus == 1){
                        if(this.ckForm.standardSwitchValue){
                            this.ckForm.specialSwitchValue = false
                            this.ckForm.isCkSpecialShow = false
                        }else{
                            this.ckForm.coldRuleStatus = 0
                            this.ckForm.isCkColdShow = true
                            this.ckForm.coldWeightStatus = 0
                            this.ckForm.isCkColdWeightShow = true
                            this.$message.warning('标准规则配置和特殊规则配置不能同时关闭！', 6)
                        }
                    }
                }
            },
            // 出库冷库续重选择
            ckColdWeightChange(e) {
                if(this.ckForm.isCkColdShow){
                    if(e.target.value == 0){
                        this.ckForm.coldWeightStatus = 0
                        this.ckForm.isCkColdWeightShow = true

                        this.ckForm.coldWeightRuleInfos = [
                            {
                                weightRuleType: 'cold',
                                quantity: '',
                                quantityUnit: this.ckForm.quantityUnit,
                                quantityPrice: '',
                                sku: '',
                                skuPrice: '',
                                weight: '',
                                weightPrice: '',
                            },
                        ]
                    }else{
                        this.ckForm.coldWeightStatus = 1
                        this.ckForm.isCkColdWeightShow = false

                        // this.ckForm.coldWeightRuleInfos = []
                    }
                }else{
                    if(this.ckForm.coldRuleInfos[0].weightRuleStatus == 0){
                        this.ckForm.coldWeightStatus = 1
                        this.$message.warning('请先选择是否冷库！', 6)
                    }
                }
            },
            // 出库酒水删除规则
            ckDrinksStandardCutRule(index) {
                this.ckForm.drinksRuleInfos.splice(index, 1)
                this.ckDrinksSetCutPlus()
            },
            // 出库酒水添加规则
            ckDrinksStandardPlusRule() {
                this.ckForm.drinksRuleInfos.push(
                    {
                        specialRuleType: 'drinks',
                        quantityBeginValue: '',
                        quantityEndValue: '',
                        skuBeginValue: '',
                        skuEndValue: '',
                        weightBeginValue: '',
                        weightEndValue: '',
                        quantityUnit: this.ckForm.quantityUnit,
                        rulePrice: '',
                        isCutShow: true,
                        isPlusShow: true,
                        weightRuleStatus: 0,
                    },
                )
                this.ckDrinksSetCutPlus()
            },
            // 设置出库酒水删除和添加按钮显示隐藏
            ckDrinksSetCutPlus() {
                var list = this.ckForm.drinksRuleInfos
                if(list.length == 1){
                    list[0].isCutShow = false
                    list[0].isPlusShow = true
                }else if(list.length > 1){
                    for(var item of list){
                        item.isCutShow = true
                        item.isPlusShow = false
                    }
                    list[list.length-1].isPlusShow = true
                }

                // 查看时隐藏删除添加按钮
                if(this.btnDisabled){
                    for(var item of list){
                        item.isCutShow = false
                        item.isPlusShow = false
                    }
                }

                this.ckForm.drinksRuleInfos = list
                this.$forceUpdate()
            },
            // 出库酒水选择
            ckDrinksChange(e) {
                if(e.target.value == 0){
                    this.ckForm.drinksRuleStatus = 0
                    this.ckForm.isCkDrinksShow = true
                    this.ckForm.drinksWeightStatus = 0
                    this.ckForm.isCkDrinksWeightShow = true

                    this.ckForm.drinksRuleInfos = [
                        {
                            specialRuleType: 'drinks',
                            quantityBeginValue: '',
                            quantityEndValue: '',
                            skuBeginValue: '',
                            skuEndValue: '',
                            weightBeginValue: '',
                            weightEndValue: '',
                            quantityUnit: this.ckForm.quantityUnit,
                            rulePrice: '',
                            isCutShow: false,
                            isPlusShow: true,
                            weightRuleStatus: 0,
                        }
                    ]
                    this.ckForm.drinksWeightRuleInfos = [
                        {
                            weightRuleType: 'drinks',
                            quantity: '',
                            quantityUnit: this.ckForm.quantityUnit,
                            quantityPrice: '',
                            sku: '',
                            skuPrice: '',
                            weight: '',
                            weightPrice: '',
                        },
                    ]
                }else{
                    this.ckForm.drinksRuleStatus = 1
                    this.ckForm.isCkDrinksShow = false
                    this.ckForm.drinksWeightStatus = 1
                    this.ckForm.isCkDrinksWeightShow = false

                    // 判断是否关闭整个特殊规则配置
                    if(this.ckForm.coldRuleStatus == 1){
                        if(this.ckForm.standardSwitchValue){
                            this.ckForm.specialSwitchValue = false
                            this.ckForm.isCkSpecialShow = false
                        }else{
                            this.ckForm.drinksRuleStatus = 0
                            this.ckForm.isCkDrinksShow = true
                            this.ckForm.drinksWeightStatus = 0
                            this.ckForm.isCkDrinksWeightShow = true
                            this.$message.warning('标准规则配置和特殊规则配置不能同时关闭！', 6)
                        }
                    }
                }
            },
            // 出库酒水续重选择
            ckDrinksWeightChange(e) {
                if(this.ckForm.isCkDrinksShow){
                    if(e.target.value == 0){
                        
                        this.ckForm.isCkDrinksWeightShow = true
                        this.ckForm.drinksWeightStatus = 0

                        this.ckForm.drinksWeightRuleInfos = [
                            {
                                weightRuleType: 'drinks',
                                quantity: '',
                                quantityUnit: this.ckForm.quantityUnit,
                                quantityPrice: '',
                                sku: '',
                                skuPrice: '',
                                weight: '',
                                weightPrice: '',
                            },
                        ]
                    }else{
                        this.ckForm.drinksWeightStatus = 1
                        this.ckForm.isCkDrinksWeightShow = false
                        
                        // this.ckForm.drinksWeightRuleInfos = []
                    }
                }else{
                    if(this.ckForm.drinksRuleInfos[0].weightRuleStatus == 0){
                        this.ckForm.drinksWeightStatus = 1
                        this.$message.warning('请先选择是否酒水订单！', 6)
                    }
                }
            },

        },
        
    }
</script>

<style lang="less" scoped>
    .checkWorkAccount{
        width: 100%;
        padding: 0 10px 10px 10px;
        font-style: Microsoft YaHei;
        background: #ffffff;
        box-sizing: border-box;
        .top_operation{
            margin-bottom: 10px;
            overflow: hidden;
            .every_operation{
                float: left;
                margin-top: 10px;
                margin-right: 20px;
                span{
                    display: inline-block;
                    width: 85px;
                }
            }
            .button_div{
                float: left;
                margin-top: 10px;
            }
        }
        .select_number{
            width: 100%;
            height: 36px;
            padding-left: 20px;
            margin-bottom: 10px;
            box-sizing: border-box;
            background: rgba(57, 72, 103, .22);
            line-height: 36px;
            .number_span{
                color: #ffffff;
                margin-right: 30px;
                b{
                    color: #394867;
                    margin: 0 15px;
                }
            }
            .clear_span{
                cursor: pointer;
                color: #394867;
            }
        }
        .add_btn{
            margin-bottom: 10px;
        }
        .data_source_list{
            h3{
                font-weight: bold;
            }
            .data_pagination{
                width: 100%;
                height: 32px;
                margin: 20px 0 10px 0;
            }
        }
    }
</style>